Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. .NET
  3. BitFaster.Caching

BitFaster.Caching

MITC#v2.6.0

High-performance, thread-safe in-memory caching primitives for .NET with advanced eviction policies.

GitHubGitHub
601 stars41 forks0 contributors

What is BitFaster.Caching?

BitFaster.Caching is a .NET library that provides high-performance, thread-safe in-memory caching primitives. It solves the problem of efficient data caching in concurrent applications by offering advanced eviction policies like 2Q and W-TinyLFU, which outperform traditional LRU approaches while maintaining scalability.

Target Audience

.NET developers building high-throughput applications that require efficient, concurrent in-memory caching with bounded size and predictable performance.

Value Proposition

Developers choose BitFaster.Caching for its lock-free design, superior hit rates compared to basic LRU, and drop-in compatibility with ConcurrentDictionary, making it easy to integrate into existing codebases while significantly improving cache performance.

Overview

High performance, thread-safe in-memory caching primitives for .NET

Use Cases

Best For

  • Implementing bounded-size caches in high-concurrency .NET services
  • Replacing ConcurrentDictionary with eviction-aware caching
  • Applications requiring near-optimal cache hit rates with W-TinyLFU
  • Mitigating cache stampede with atomic value factories
  • Caching disposable resources with thread-safe lifetime management
  • Performance-critical scenarios where low-latency caching is essential

Not Ideal For

  • Applications requiring distributed caching or persistence across server restarts, as it's purely in-memory
  • Projects with very low concurrency where simpler caches like MemoryCache suffice without advanced tuning
  • Teams needing out-of-the-box integration with .NET's IMemoryCache abstraction for seamless framework use
  • Scenarios where automatic sliding expiration is critical, as time-based eviction requires manual configuration

Pros & Cons

Pros

Lock-Free High Performance

Designed for lock-free concurrency with high throughput and predictable latency, prioritizing scalability in concurrent environments, as highlighted in its philosophy.

Advanced Eviction Algorithms

Implements state-of-the-art policies like 2Q for LRU and W-TinyLFU for LFU, providing near-optimal hit rates that outperform traditional LRU caches, per the wiki documentation.

Drop-In Replacement

ConcurrentLru and ConcurrentLfu can be used just like ConcurrentDictionary with bounded size, making integration straightforward, as shown in the getting started examples.

Cache Stampede Prevention

Configurable atomic valueFactory ensures only one thread computes a value for a missing key, mitigating cache stampede issues, a key feature documented in the wiki.

Thread-Safe Disposable Support

Provides wrappers for IDisposable cache values with scoped lifetime management, enabling safe caching of resources that require cleanup, as detailed in the wiki.

Cons

In-Memory Only

Lacks built-in support for distributed caching or persistence, limiting use to single-instance applications unless combined with external storage solutions.

Configuration Complexity

Advanced features like time-based eviction or metrics require setup and understanding of caching algorithms, which may be daunting for developers new to performance tuning.

Limited Framework Integration

Does not natively integrate with common .NET caching abstractions like IMemoryCache, necessitating custom implementations for frameworks like ASP.NET Core.

Niche Documentation

Documentation is wiki-based and may be less accessible or comprehensive compared to mainstream libraries, potentially slowing onboarding for some teams.

Frequently Asked Questions

Quick Stats

Stars601
Forks41
Contributors0
Open Issues2
Last commit5 days ago
CreatedSince 2020

Tags

#lfu-cache#in-memory-cache#lru-cache#caching#nuget-package#lru#concurrent-programming#dotnet#thread-safe#threadsafe#cache#performance

Built With

.
.NET

Included in

.NET21.2k
Auto-fetched 4 hours ago

Related Projects

FusionCacheFusionCache

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.

Stars3,802
Forks193
Last commit1 month ago
AkavacheAkavache

An asynchronous, persistent key-value store created for writing desktop and mobile applications, based on SQLite3. Akavache is great for both storing important data as well as cached local data that expires.

Stars2,547
Forks281
Last commit2 days ago
CacheManagerCacheManager

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.

Stars2,419
Forks454
Last commit4 months ago
EasyCachingEasyCaching

:boom: EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!

Stars2,093
Forks336
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub