You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-23Lines changed: 29 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -149,19 +149,17 @@ In these benchmarks, a cache miss is essentially free. These tests exist purely
149
149
150
150
Benchmarks are based on BenchmarkDotNet, so are single threaded. The ConcurrentLru family of classes are composed internally of ConcurrentDictionary.GetOrAdd and ConcurrentQueue.Enqueue/Dequeue method calls, and scale well to concurrent workloads.
151
151
152
-
Benchmark results below are from a computer with a mobile class Broadwell CPU with small caches (128kb L1/512kb L2/4mb L3):
152
+
Benchmark results below are from a workstation with the following config:
Benchmarks have been repeated across supported .NET Frameworks and on the CPU architectures available in Azure (e.g. Intel Skylake, AMD Zen). Results are repeatable within +/-5%.
161
+
162
+
The relative ranking of each cache implementation is stable across .NET Framework/Core/5/6 and on the CPU architectures available in Azure (e.g. Intel Skylake, AMD Zen). Absolute performance can vary.
165
163
166
164
### What are FastConcurrentLru/FastConcurrentTLru?
167
165
@@ -192,19 +190,27 @@ In this test the same items are fetched repeatedly, no items are evicted. Repres
192
190
- Classic Lru must maintain item order, and is internally splicing the fetched item to the head of the linked list.
193
191
- MemoryCache and ConcurrentDictionary represent a pure lookup. This is the best case scenario for MemoryCache, since the lookup key is a string (if the key were a Guid, using MemoryCache adds string conversion overhead).
194
192
195
-
FastConcurrentLru does not allocate and is approximately 10x faster than System.Runtime.Caching.MemoryCache or the newer Microsoft.Extensions.Caching.Memory.MemoryCache.
196
-
197
-
| Method | Mean | Error | StdDev | Ratio | Gen 0 | Allocated |
FastConcurrentLru does not allocate and is approximately 5-10x faster than System.Runtime.Caching.MemoryCache or the newer Microsoft.Extensions.Caching.Memory.MemoryCache.
194
+
195
+
| Method | Runtime | Mean | StdDev | Ratio |Allocated |
0 commit comments