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.
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
Add context cache as a request level cache #22294
Add context cache as a request level cache #22294
Changes from 1 commit
901cdb2
94a7ddf
1c89c15
109979d
96b7e2d
e455e8b
4a2f3fe
f1e7b34
1f68f88
4727355
89600f7
696e0d3
b0f0267
728ae6c
57187ef
35221d6
5a1fad6
8a3294e
bb279f6
296b9c2
3f2869d
d25b6b5
a98791c
3b26a55
95375f7
669d5c3
1474785
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I have a feeling that making this an unlimited map instead of something limited in size will bite us as more and more things use to use the cache.
Whilst LRUs have an overhead it might be a better idea to make this a generous LRU.
I guess it might be sensible to provide a few implementations of a context cache (LRU/hard limit map/no limit map) here, AND/OR to add some trace logging/pprof metrics that counts the number of entities that gets stored in these maps.
As an aside the complicated changes within models/settings do show the failure of the current design of our db services - these probably need to be migrated to service interfaces which would allow for simpler cache wrapping interfaces.
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.
For a request, I cannot imagine it's an unlimited map. And in fact, all the values are pointers, only keys are in this map. When a request is end, the map and related objects will be GC.