Git Product home page Git Product logo

Comments (4)

jodydonetti avatar jodydonetti commented on June 12, 2024 1

Hi @raghumirajkar and thanks for using FusionCache.

expected fusion cache to be more performant

FusionCache underneath uses IMemoryCache for L1 and IDistributedCache for L2, see the intro here:

It uses a memory cache (any impl of the standard IMemoryCache interface) as the primary backing store and, optionally, a distributed cache (any impl of the standard IDistributedCache interface) as a secondary backing store for better resilience and higher performance, for example in a multi-node scenario or to avoid the typical effects of a cold start (initial empty cache, maybe after a restart).

Because of this it cannot physically be faster than MemoryCache, since it is in fact MemoryCache + extra features.

One question you may pose yourself is "then why should I use FusionCache, instead of simply using MemoryCache?" and the answer to that are all the extra features of FusionCache like cache stampede prevention, an optional 2nd level, fail-safe, soft/hard timeouts, backplane, auto-recovery and many more.

Hope this helps, let me know.

PS: I'm experimenting with a new version that will use a more optimized memory cache for the L1 then MemoryCache, but there's nothing to see yet.

PPS: I'm also keeping an eye on this which may or may not come with .NET 9.

from fusioncache.

madhub avatar madhub commented on June 12, 2024

@jodydonetti Have you explored alternative like https://github.com/bitfaster/BitFaster.Caching for L1 cache instead of .NET MemoryCache ?

from fusioncache.

jodydonetti avatar jodydonetti commented on June 12, 2024

Hi @madhub , yep totally, on top of others.
It's something I'm experimenting with from some time, playing with different designs, benchmarking them, etc.

One idea may be to have a new IFusionCacheMemoryLevel or something like that so that we can switch between different implementations, like we already can with IDistributedCache or IFusionCacheBackplane.

Another idea is that I may also end up creating an optimized one specifically for FusionCache, and use that instead of depending on a 3rd party one.

Again, I'm playing with different designs and waiting to see what .NET 9 will bring to the table.

In the case of BitFaster.Caching for example there's the problem that the Duration is per-cache and not per-cache-entry, see here.

from fusioncache.

jodydonetti avatar jodydonetti commented on June 12, 2024

I'm closing this: if you think I've missed something let me know and I'll gladly re-open it.

from fusioncache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.