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

IDistributedCache updates #7415

Open
DmitriyKulagin opened this issue Nov 15, 2024 · 2 comments
Open

IDistributedCache updates #7415

DmitriyKulagin opened this issue Nov 15, 2024 · 2 comments
Assignees

Comments

@DmitriyKulagin
Copy link
Contributor

Consider using the new HybridCache library.

@skoshelev
Copy link
Contributor

Unfortunately, the current implementation of the HybridCache abstraction has a number of limitations, such as the need to serialize objects placed in the cache, which dramatically reduces performance (three times)and increases resource usage (two times). Also, we still need to make separate RemoveByPrefix methods for each caching option, since HybridCache does not provide such calls, and sequential removal of keys, as done for MemoryCacheManager, works very suboptimally in the case of distributed caching.

HybridCache is still in preview but will be fully released after .NET 9.0 in a future minor release of .NET Extensions.

Taking into account all of the above, we decided to leave our abstraction with IStaticCacheManager and a separate implementation of managers for each caching type we support

We will postpone this ticket for now, but for those who want to experiment, we have prepared a preliminary version of the transition to HybridCache

@skoshelev
Copy link
Contributor

Comparison of caching versions by key addition time and memory consumption
HybridCache inserts 10000 strings:
Image
IStaticCacheManager inserts 10000 strings:
Image
HybridCache inserts 1000000 strings:
Image
IStaticCacheManager inserts 1000000 strings:
Image

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

No branches or pull requests

3 participants