Skip to content

Add caching for KeySerializers, similar to regular value serializers #947

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
cowtowncoder opened this issue Sep 25, 2015 · 2 comments
Closed

Comments

@cowtowncoder
Copy link
Member

(spin-off from #943)

Although it is possible to add local caching for key serializers of Map types, it may make sense to also add global cache, used via SerializerProvider.findKeySerializer(...). This would reduce cost of lookup misses from local cache, or eliminate need for local caches altogether.

The reason caching is important, in general, is that due to extensive configuration via annotations, modular extension mechanisms, optional contextualization and other advanced feature, the actual lookup by type is rather a complicated process. So instead of trying to go crazy optimizing lookups (which may or may not even be possible; any module can request callbacks to be done during lookups) it often makes sense to make sure resulting handler is cached for future (dynamic) lookups.

@cowtowncoder cowtowncoder changed the title (2.7) Add caching for KeySerializers, similar to regular value serializers (2.8) Add caching for KeySerializers, similar to regular value serializers Feb 12, 2016
@cowtowncoder cowtowncoder changed the title (2.8) Add caching for KeySerializers, similar to regular value serializers Add caching for KeySerializers, similar to regular value serializers May 4, 2016
@cowtowncoder
Copy link
Member Author

Still not sure it'll get in 2.8 so...

@cowtowncoder cowtowncoder removed the 2.8 label May 4, 2016
@cowtowncoder cowtowncoder modified the milestone: 2.11.0 Oct 16, 2019
@cowtowncoder cowtowncoder added 2.11 and removed 2.11 labels Oct 16, 2019
@cowtowncoder
Copy link
Member Author

At this point question is this: while adding cache would be easy enough, is there data to show that 2 levels of cache (global for serializers, local for "dynamic keys") does not work?
If yes, can be worked on, solve. But right now I don't have anything; and none of test cases (including "wasteful ones") can quite show problem.

So, closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant