-
Notifications
You must be signed in to change notification settings - Fork 184
Introduce codec mapping caches (0.8.x branch) #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
frdeboffles
wants to merge
1
commit into
pgjdbc:0.8.x
from
frdeboffles:feature-gh-409-codec-mapping-cache-0.8.x
Closed
Introduce codec mapping caches (0.8.x branch) #444
frdeboffles
wants to merge
1
commit into
pgjdbc:0.8.x
from
frdeboffles:feature-gh-409-codec-mapping-cache-0.8.x
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…decoding performances. * Refactored the codec registry to use a CodecFinder (default to SPI definition in the classpath) * Switched the codec list to a thread safe variant to avoid the synchronized blocks. Even though `CopyOnWriteArrayList` is not super performant it should work fine in this context where the list should not be frequently updated. * Provided 2 implementations of the codec finder, one without cache and another with cache * Added a build cache method that will attempt to fill the cache when the codecs are updated. This cannot covers all the cases like the nested arrays, therefore for those type the cache will be filled dynamically on per-request basis * Added microbenchmarks for codec encode and decode using the cache based implementation or not * Switched `mockito-core` to `mockito-junit-jupiter` for Junit 5 support * Disabled unixDomainSocketTest IT when running on Mac or Windows
mp911de
reviewed
Sep 22, 2021
<postgresql.version>42.2.20</postgresql.version> | ||
<logback.version>1.2.5</logback.version> | ||
<mockito.version>3.12.4</mockito.version> | ||
<netty.version>4.1.66.Final</netty.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrading dependencies isn't a concern that belongs into such a change.
mp911de
pushed a commit
that referenced
this pull request
Sep 22, 2021
…rmances. * Switched the codec list to a thread safe variant to avoid the synchronized blocks. Even though `CopyOnWriteArrayList` is not super performant it should work fine in this context where the list should not be frequently updated. * Switched `mockito-core` to `mockito-junit-jupiter` for Junit 5 support * Refactored the codec registry to use a CodecFinder (default to SPI definition in the classpath) * Provided 2 implementations of the codec finder, one without cache and another with cache * Added a build cache method that will attempt to fill the cache when the codecs are updated. This cannot covers all the cases like the nested arrays, therefore for those type the cache will be filled dynamically on per-request basis * Added microbenchmarks for codec encode and decode using the cache based implementation or not * Disabled unixDomainSocketTest IT when running on Windows [#444][resolves #409]
mp911de
added a commit
that referenced
this pull request
Sep 22, 2021
Rename CodecFinder to CodecLookup. Rename default implementations to CachedCodecLookup and DefaultCodecLookup. Extract CodecMetadata interface and turn getFormats() into a default method. Refactor how CodecLookup obtains its actual codecs to prevent methods allowing to alter the internal state of the cache component through updateCodecs(…). The delegate is typically a CodecRegistry for iteration over the actual codecs. Reinstate socket tests on MacOS as sockets are supported on BSD via kqueue. Remove overly complex spy arrangements from tests. Refine tests. [resolves #444][#409] Signed-off-by: Mark Paluch <[email protected]>
Thank you for your contribution. That's merged and polished now. |
mp911de
added a commit
that referenced
this pull request
Sep 22, 2021
Fix benchmarks after polishing. [#444][#409] Signed-off-by: Mark Paluch <[email protected]>
mp911de
added a commit
that referenced
this pull request
Sep 23, 2021
Use constructor delegation in DefaultCodecs. [#444][#409] Signed-off-by: Mark Paluch <[email protected]>
mp911de
added a commit
that referenced
this pull request
Sep 23, 2021
Fix benchmarks after polishing. [#444][#409] Signed-off-by: Mark Paluch <[email protected]>
mp911de
added a commit
that referenced
this pull request
Sep 23, 2021
Use constructor delegation in DefaultCodecs. [#444][#409] Signed-off-by: Mark Paluch <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce codec mapping caches to improve encoding and decoding performances.
CodecFinder
(default to SPI definition in the classpath)CopyOnWriteArrayList
is not super performant it should work fine in this context where the list should not be frequently updated.mockito-core
tomockito-junit-jupiter
for Junit 5 supportJMH results:
Make sure that:
Issue description
See gh-409
New Public APIs
Additional context