@@ -43,32 +43,31 @@ Cache contains 6 items which are fetched repeatedly, no items are evicted. Repre
4343
4444FastConcurrentLru does not allocate and is approximately 10x faster than MemoryCache.
4545
46- | Method | Mean | Error | StdDev | Ratio | Gen 0 | Allocated |
47- | ----------------------------- | ----------:| ---------:| ---------:| ------:| -------:| ----------:|
48- | ConcurrentDictionaryGetOrAdd | 18.72 ns | 0.289 ns | 0.641 ns | 1.00 | - | - |
49- | FastConcurrentLruGetOrAdd | 25.64 ns | 0.434 ns | 0.427 ns | 1.35 | - | - |
50- | ConcurrentLruGetOrAdd | 35.53 ns | 0.259 ns | 0.216 ns | 1.86 | - | - |
51- | FastConcurrentTLruGetOrAdd | 132.75 ns | 1.493 ns | 1.397 ns | 6.96 | - | - |
52- | ConcurrentTLruGetOrAdd | 144.87 ns | 2.179 ns | 1.819 ns | 7.59 | - | - |
53- | ClassicLruGetOrAdd | 75.67 ns | 1.513 ns | 1.554 ns | 3.99 | - | - |
54- | MemoryCacheGetStringKey | 309.14 ns | 2.155 ns | 1.910 ns | 16.17 | 0.0153 | 32 B |
46+ | Method | Mean | Error | StdDev | Ratio | Gen 0 | Allocated |
47+ | --------------------- | ----------:| ---------:| ---------:| ------:| -------:| ----------:|
48+ | ConcurrentDictionary | 15.83 ns | 0.242 ns | 0.215 ns | 1.00 | - | - |
49+ | FastConcurrentLru | 20.42 ns | 0.319 ns | 0.283 ns | 1.29 | - | - |
50+ | ConcurrentLru | 24.59 ns | 0.484 ns | 0.594 ns | 1.56 | - | - |
51+ | FastConcurrentTLru | 110.76 ns | 0.664 ns | 0.518 ns | 6.98 | - | - |
52+ | ConcurrentTLru | 114.99 ns | 1.652 ns | 1.465 ns | 7.27 | - | - |
53+ | ClassicLru | 69.01 ns | 0.503 ns | 0.446 ns | 4.36 | - | - |
54+ | MemoryCache | 257.83 ns | 4.786 ns | 4.700 ns | 16.30 | 0.0153 | 32 B |
5555
5656### Mixed workload
5757
5858Tests 4 operations, 1 miss (adding the item), 2 hits then remove.
5959
6060This test needs to be improved to provoke queue cycling.
6161
62-
6362| Method | Mean | Error | StdDev | Ratio | Gen 0 | Allocated |
6463| --------------------- | -----------:| ---------:| ---------:| ------:| -------:| ----------:|
65- | ConcurrentDictionary | 178.1 ns | 1.47 ns | 1.23 ns | 1.00 | 0.0381 | 80 B |
66- | FastConcurrentLru | 420.4 ns | 7.52 ns | 6.67 ns | 2.36 | 0.0534 | 112 B |
67- | ConcurrentLru | 423.7 ns | 3.17 ns | 2.64 ns | 2.38 | 0.0534 | 112 B |
68- | FastConcurrentTlru | 941 .6 ns | 6.69 ns | 5.93 ns | 5.29 | 0.0572 | 120 B |
69- | ConcurrentTlru | 960.3 ns | 17.73 ns | 14.80 ns | 5.39 | 0.0572 | 120 B |
70- | ClassicLru | 363.5 ns | 3.65 ns | 3.23 ns | 2.04 | 0.0763 | 160 B |
71- | MemoryCache | 2,380.9 ns | 33.22 ns | 27.74 ns | 13.37 | 2.3460 | 4912 B |
64+ | ConcurrentDictionary | 151.7 ns | 2.34 ns | 1.96 ns | 1.00 | 0.0381 | 80 B |
65+ | FastConcurrentLru | 369.2 ns | 7.29 ns | 7.16 ns | 2.44 | 0.0534 | 112 B |
66+ | ConcurrentLru | 373.6 ns | 2.97 ns | 2.64 ns | 2.46 | 0.0534 | 112 B |
67+ | FastConcurrentTlru | 838 .6 ns | 11.49 ns | 13.68 ns | 5.53 | 0.0572 | 120 B |
68+ | ConcurrentTlru | 852.7 ns | 16.12 ns | 13.46 ns | 5.62 | 0.0572 | 120 B |
69+ | ClassicLru | 347.3 ns | 2.67 ns | 2.08 ns | 2.29 | 0.0763 | 160 B |
70+ | MemoryCache | 1,987.5 ns | 38.29 ns | 57.31 ns | 13.15 | 2.3460 | 4912 B |
7271
7372
7473### LruCycle2
0 commit comments