Skip to content
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 multi-level cache design #375

Open
vearne opened this issue Sep 15, 2023 · 2 comments
Open

Add multi-level cache design #375

vearne opened this issue Sep 15, 2023 · 2 comments

Comments

@vearne
Copy link

vearne commented Sep 15, 2023

Like ehcache,Some hotspot key-values reside directly in the heap, while other key-values are stored in the original way.

@janisz
Copy link
Collaborator

janisz commented Sep 15, 2023

actually we keep values in the heap. Could you elaborate?

@vearne
Copy link
Author

vearne commented Sep 19, 2023

I have a scenario where I want to store 10,000,000 key-value in the local cache, but this value is a relatively complex object. According to the current logic of bigcache, the value will be serialized into bytes for storage, and then actually, when I want to use Sometimes, I need to deserialize value from bytes into objects. Since this service is a high-frequency request, value will be serialized into objects repeatedly, causing a lot of CPU consumption. So I wonder if I can add a cache and store high-frequency key-values directly in the map (for example, using segmentation locks). This can reduce the cost of deserializing values from bytes into objects.

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

2 participants