bigcache icon indicating copy to clipboard operation
bigcache copied to clipboard

Add multi-level cache design

Open vearne opened this issue 2 years ago • 2 comments

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

vearne avatar Sep 15 '23 08:09 vearne

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

janisz avatar Sep 15 '23 09:09 janisz

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.

vearne avatar Sep 19 '23 02:09 vearne