Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions BitFaster.Caching.Benchmarks/Lru/LruCycleBench.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@

namespace BitFaster.Caching.Benchmarks.Lru
{
//BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
//Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
//.NET SDK= 6.0.100
// [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
// DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT


//| Method | Mean | Error | StdDev | Code Size | Gen 0 | Allocated |
//|------------------- |---------:|---------:|---------:|----------:|-------:|----------:|
//| FastConcurrentLru | 22.61 us | 0.125 us | 0.110 us | 0 KB | 2.1362 | 9 KB |
//| ConcurrentLru | 24.39 us | 0.389 us | 0.364 us | 0 KB | 2.1362 | 9 KB |
//| FastConcurrentTLru | 31.28 us | 0.067 us | 0.062 us | 1 KB | 2.3193 | 10 KB |
//| ConcurrentTLru | 31.75 us | 0.074 us | 0.062 us | 1 KB | 2.3193 | 10 KB |
[DisassemblyDiagnoser(printSource: true)]
[MemoryDiagnoser]
public class LruCycleBench
Expand Down
17 changes: 17 additions & 0 deletions BitFaster.Caching.Benchmarks/Lru/LruJustGetOrAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@

namespace BitFaster.Caching.Benchmarks
{
//BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
//Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
//.NET SDK= 6.0.100
// [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
// DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT


//| Method | Mean | Error | StdDev | Ratio | RatioSD | Code Size | Gen 0 | Allocated |
//|------------------------- |-----------:|----------:|----------:|------:|--------:|----------:|-------:|----------:|
//| ConcurrentDictionary | 7.761 ns | 0.0393 ns | 0.0307 ns | 1.00 | 0.00 | 340 B | - | - |
//| FastConcurrentLru | 9.559 ns | 0.0625 ns | 0.0585 ns | 1.23 | 0.01 | 427 B | - | - |
//| ConcurrentLru | 13.580 ns | 0.0531 ns | 0.0443 ns | 1.75 | 0.01 | 449 B | - | - |
//| FastConcurrentTLru | 27.109 ns | 0.1041 ns | 0.0813 ns | 3.49 | 0.02 | 613 B | - | - |
//| ConcurrentTLru | 29.622 ns | 0.2369 ns | 0.2216 ns | 3.81 | 0.03 | 684 B | - | - |
//| ClassicLru | 48.060 ns | 0.2447 ns | 0.2169 ns | 6.19 | 0.03 | 738 B | - | - |
//| RuntimeMemoryCacheGet | 106.117 ns | 0.4677 ns | 0.4375 ns | 13.69 | 0.08 | 49 B | 0.0074 | 32 B |
//| ExtensionsMemoryCacheGet | 92.386 ns | 0.4539 ns | 0.4023 ns | 11.91 | 0.07 | 78 B | 0.0055 | 24 B |
[DisassemblyDiagnoser(printSource: true)]
[MemoryDiagnoser]
public class LruJustGetOrAdd
Expand Down
12 changes: 12 additions & 0 deletions BitFaster.Caching.Benchmarks/Lru/LruJustTryGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@

namespace BitFaster.Caching.Benchmarks.Lru
{
//BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
//Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
//.NET SDK= 6.0.100
// [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
// DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT


//| Method | Mean | Error | StdDev | Ratio | RatioSD | Code Size | Allocated |
//|--------------------- |----------:|----------:|----------:|------:|--------:|----------:|----------:|
//| ConcurrentDictionary | 4.421 ns | 0.0295 ns | 0.0276 ns | 1.00 | 0.00 | 364 B | - |
//| FastConcurrentLru | 7.645 ns | 0.0339 ns | 0.0300 ns | 1.73 | 0.02 | 339 B | - |
//| FastConcurrentTLru | 26.139 ns | 0.0741 ns | 0.0619 ns | 5.92 | 0.04 | 437 B | - |
[DisassemblyDiagnoser(printSource: true)]
[MemoryDiagnoser]
public class LruJustTryGet
Expand Down
1 change: 1 addition & 0 deletions BitFaster.Caching.Benchmarks/Lru/LruMultiGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace BitFaster.Caching.Benchmarks.Lru
{
[DisassemblyDiagnoser(printSource: true)]
[MemoryDiagnoser]
public class LruMultiGet
{
Expand Down
16 changes: 16 additions & 0 deletions BitFaster.Caching.Benchmarks/Lru/LruZipDistribution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@

namespace BitFaster.Caching.Benchmarks.Lru
{
//BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
//Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
//.NET SDK= 6.0.100
// [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
// DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT


//| Method | Mean | Error | StdDev | Ratio | RatioSD | Gen 0 | Code Size | Allocated |
//|------------------- |---------:|--------:|--------:|------:|--------:|-------:|----------:|----------:|
//| ClassicLru | 108.4 ns | 0.26 ns | 0.20 ns | 1.00 | 0.00 | 0.0154 | 799 B | 67 B |
//| FastConcurrentLru | 123.1 ns | 0.97 ns | 0.86 ns | 1.14 | 0.01 | 0.0093 | 488 B | 41 B |
//| ConcurrentLru | 128.7 ns | 2.12 ns | 1.98 ns | 1.19 | 0.02 | 0.0093 | 510 B | 40 B |
//| FastConcurrentTLru | 166.1 ns | 0.99 ns | 0.83 ns | 1.53 | 0.01 | 0.0100 | 674 B | 43 B |
//| ConcurrentTLru | 172.2 ns | 0.52 ns | 0.46 ns | 1.59 | 0.00 | 0.0103 | 745 B | 45 B |
[DisassemblyDiagnoser(printSource: true)]
[MemoryDiagnoser]
public class LruZipDistribution
{
const double s = 0.86;
Expand Down