BitFaster.Caching 2.6.1
⚡ BitFaster.Caching
High performance, thread-safe in-memory caching primitives for .NET.
ConcurrentLru
ConcurrentLru is a light weight drop in replacement for ConcurrentDictionary, but with bounded size enforced by the TU-Q eviction policy (based on 2Q). There are no background threads, no global locks, concurrent throughput is high, lookups are fast and hit rate outperforms a pure LRU in all tested scenarios.
Choose a capacity and use just like ConcurrentDictionary, but with bounded size:
int capacity = 128;
var lru = new ConcurrentLru<string, SomeItem>(capacity);
var value = lru.GetOrAdd("key", (key) => new SomeItem(key));
Optionally configure ConcurrentLru with a time-based eviction policy, either:
- Expire after write
- Expire after access
- Calculate an expiry time per item
ConcurrentLfu
ConcurrentLfu is a drop in replacement for ConcurrentDictionary, but with bounded size enforced by the W-TinyLFU admission policy. ConcurrentLfu has near optimal hit rate and high scalability. Reads and writes are buffered then replayed asynchronously to mitigate lock contention.
Choose a capacity and use just like ConcurrentDictionary, but with bounded size:
int capacity = 128;
var lfu = new ConcurrentLfu<string, SomeItem>(capacity);
var value = lfu.GetOrAdd("key", (key) => new SomeItem(key));
Optionally configure ConcurrentLfu with a time-based eviction policy, either:
- Expire after write
- Expire after access
- Calculate an expiry time per item
Documentation
Please refer to the wiki for API documentation, and an analysis of hit rate, latency and throughput.
Showing the top 20 packages that depend on BitFaster.Caching.
| Packages | Downloads |
|---|---|
|
OPCFoundation.NetStandard.Opc.Ua.Core
OPC UA Core Class Library
|
7 |
|
OPCFoundation.NetStandard.Opc.Ua.Core.Schema
OPC UA runtime schema generation (XSD, OPC Binary and JSON Schema) for encodeable and complex data types.
|
2 |
|
OPCFoundation.NetStandard.Opc.Ua.Server
OPC UA Server Class Library
|
1 |
|
OPCFoundation.NetStandard.Opc.Ua.Core.Schema
OPC UA runtime schema generation (XSD, OPC Binary and JSON Schema) for encodeable and complex data types.
|
1 |
|
OPCFoundation.NetStandard.Opc.Ua.Gds.Common
OPC UA GDS Class Library
|
1 |
|
OPCFoundation.NetStandard.Opc.Ua.Core
OPC UA Core Class Library
|
1 |
|
OPCFoundation.NetStandard.Opc.Ua.Configuration
OPC UA Configuration Class Library
|
1 |
.NET 10.0
- No dependencies.
.NET 6.0
- No dependencies.
.NET Core 3.1
- No dependencies.
.NET Standard 2.0
- System.Threading.Tasks.Extensions (>= 4.5.4)
| Version | Downloads | Last updated |
|---|---|---|
| 2.6.1 | 5 | 27.08.2026 |
| 2.6.0 | 7 | 22.08.2026 |
| 2.5.4 | 4 | 22.08.2026 |
| 2.5.3 | 4 | 22.08.2026 |
| 2.5.2 | 3 | 22.08.2026 |
| 2.5.1 | 4 | 22.08.2026 |
| 2.5.0 | 4 | 22.08.2026 |
| 2.4.1 | 4 | 22.08.2026 |
| 2.4.0 | 4 | 23.08.2026 |
| 2.3.3 | 4 | 22.08.2026 |
| 2.3.2 | 2 | 25.08.2026 |
| 2.3.1 | 4 | 22.08.2026 |
| 2.3.0 | 4 | 22.08.2026 |
| 2.2.1 | 4 | 22.08.2026 |
| 2.2.0 | 2 | 25.08.2026 |
| 2.1.3 | 4 | 22.08.2026 |
| 2.1.2 | 4 | 22.08.2026 |
| 2.1.1 | 4 | 22.08.2026 |
| 2.1.0 | 5 | 22.08.2026 |
| 2.0.0 | 4 | 22.08.2026 |
| 1.1.0 | 3 | 22.08.2026 |
| 1.0.7 | 4 | 22.08.2026 |
| 1.0.6 | 5 | 22.08.2026 |
| 1.0.5 | 4 | 22.08.2026 |
| 1.0.4 | 4 | 22.08.2026 |
| 1.0.3 | 4 | 22.08.2026 |
| 1.0.2 | 5 | 22.08.2026 |
| 1.0.1 | 5 | 22.08.2026 |
| 1.0.0 | 3 | 22.08.2026 |
| 0.9.4 | 4 | 22.08.2026 |
| 0.9.3 | 4 | 22.08.2026 |
| 0.9.2 | 3 | 22.08.2026 |
| 0.9.1 | 4 | 22.08.2026 |