File tree Expand file tree Collapse file tree 5 files changed +59
-0
lines changed
BitFaster.Caching.Benchmarks/Lru Expand file tree Collapse file tree 5 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 88
99namespace BitFaster . Caching . Benchmarks . Lru
1010{
11+ //BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
12+ //Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
13+ //.NET SDK= 6.0.100
14+ // [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
15+ // DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
16+
17+
18+ //| Method | Mean | Error | StdDev | Code Size | Gen 0 | Allocated |
19+ //|------------------- |---------:|---------:|---------:|----------:|-------:|----------:|
20+ //| FastConcurrentLru | 22.61 us | 0.125 us | 0.110 us | 0 KB | 2.1362 | 9 KB |
21+ //| ConcurrentLru | 24.39 us | 0.389 us | 0.364 us | 0 KB | 2.1362 | 9 KB |
22+ //| FastConcurrentTLru | 31.28 us | 0.067 us | 0.062 us | 1 KB | 2.3193 | 10 KB |
23+ //| ConcurrentTLru | 31.75 us | 0.074 us | 0.062 us | 1 KB | 2.3193 | 10 KB |
1124 [ DisassemblyDiagnoser ( printSource : true ) ]
1225 [ MemoryDiagnoser ]
1326 public class LruCycleBench
Original file line number Diff line number Diff line change 1212
1313namespace BitFaster . Caching . Benchmarks
1414{
15+ //BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
16+ //Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
17+ //.NET SDK= 6.0.100
18+ // [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
19+ // DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
20+
21+
22+ //| Method | Mean | Error | StdDev | Ratio | RatioSD | Code Size | Gen 0 | Allocated |
23+ //|------------------------- |-----------:|----------:|----------:|------:|--------:|----------:|-------:|----------:|
24+ //| ConcurrentDictionary | 7.761 ns | 0.0393 ns | 0.0307 ns | 1.00 | 0.00 | 340 B | - | - |
25+ //| FastConcurrentLru | 9.559 ns | 0.0625 ns | 0.0585 ns | 1.23 | 0.01 | 427 B | - | - |
26+ //| ConcurrentLru | 13.580 ns | 0.0531 ns | 0.0443 ns | 1.75 | 0.01 | 449 B | - | - |
27+ //| FastConcurrentTLru | 27.109 ns | 0.1041 ns | 0.0813 ns | 3.49 | 0.02 | 613 B | - | - |
28+ //| ConcurrentTLru | 29.622 ns | 0.2369 ns | 0.2216 ns | 3.81 | 0.03 | 684 B | - | - |
29+ //| ClassicLru | 48.060 ns | 0.2447 ns | 0.2169 ns | 6.19 | 0.03 | 738 B | - | - |
30+ //| RuntimeMemoryCacheGet | 106.117 ns | 0.4677 ns | 0.4375 ns | 13.69 | 0.08 | 49 B | 0.0074 | 32 B |
31+ //| ExtensionsMemoryCacheGet | 92.386 ns | 0.4539 ns | 0.4023 ns | 11.91 | 0.07 | 78 B | 0.0055 | 24 B |
1532 [ DisassemblyDiagnoser ( printSource : true ) ]
1633 [ MemoryDiagnoser ]
1734 public class LruJustGetOrAdd
Original file line number Diff line number Diff line change 77
88namespace BitFaster . Caching . Benchmarks . Lru
99{
10+ //BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
11+ //Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
12+ //.NET SDK= 6.0.100
13+ // [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
14+ // DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
15+
16+
17+ //| Method | Mean | Error | StdDev | Ratio | RatioSD | Code Size | Allocated |
18+ //|--------------------- |----------:|----------:|----------:|------:|--------:|----------:|----------:|
19+ //| ConcurrentDictionary | 4.421 ns | 0.0295 ns | 0.0276 ns | 1.00 | 0.00 | 364 B | - |
20+ //| FastConcurrentLru | 7.645 ns | 0.0339 ns | 0.0300 ns | 1.73 | 0.02 | 339 B | - |
21+ //| FastConcurrentTLru | 26.139 ns | 0.0741 ns | 0.0619 ns | 5.92 | 0.04 | 437 B | - |
1022 [ DisassemblyDiagnoser ( printSource : true ) ]
1123 [ MemoryDiagnoser ]
1224 public class LruJustTryGet
Original file line number Diff line number Diff line change 1212
1313namespace BitFaster . Caching . Benchmarks . Lru
1414{
15+ [ DisassemblyDiagnoser ( printSource : true ) ]
1516 [ MemoryDiagnoser ]
1617 public class LruMultiGet
1718 {
Original file line number Diff line number Diff line change 88
99namespace BitFaster . Caching . Benchmarks . Lru
1010{
11+ //BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
12+ //Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
13+ //.NET SDK= 6.0.100
14+ // [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
15+ // DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
16+
17+
18+ //| Method | Mean | Error | StdDev | Ratio | RatioSD | Gen 0 | Code Size | Allocated |
19+ //|------------------- |---------:|--------:|--------:|------:|--------:|-------:|----------:|----------:|
20+ //| ClassicLru | 108.4 ns | 0.26 ns | 0.20 ns | 1.00 | 0.00 | 0.0154 | 799 B | 67 B |
21+ //| FastConcurrentLru | 123.1 ns | 0.97 ns | 0.86 ns | 1.14 | 0.01 | 0.0093 | 488 B | 41 B |
22+ //| ConcurrentLru | 128.7 ns | 2.12 ns | 1.98 ns | 1.19 | 0.02 | 0.0093 | 510 B | 40 B |
23+ //| FastConcurrentTLru | 166.1 ns | 0.99 ns | 0.83 ns | 1.53 | 0.01 | 0.0100 | 674 B | 43 B |
24+ //| ConcurrentTLru | 172.2 ns | 0.52 ns | 0.46 ns | 1.59 | 0.00 | 0.0103 | 745 B | 45 B |
25+ [ DisassemblyDiagnoser ( printSource : true ) ]
26+ [ MemoryDiagnoser ]
1127 public class LruZipDistribution
1228 {
1329 const double s = 0.86 ;
You can’t perform that action at this time.
0 commit comments