C#C
C#4y ago
ero

Fast look-up algorithms

I'm looking to use a sort of cache of objects which are stored each with a unique key.
Currently, I do this simply using a Dictionary<TKey, TValue>. This is to prevent having to fetch the items anew, when I can simply get them from that cache.

My question is, what are some quicker and more efficient collections or algorithms to use for storing pairs of keys and values and fetching them when needed? (Obviously the logic to "refresh" the cache will run when an item cannot be found.)
Was this page helpful?