Caching Performance Comparison

June 25, 2022 ยท View on GitHub

Test Machine

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1766 (21H1/May2021Update)
Intel Core i7-6700HQ CPU 2.60GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
.NET SDK=6.0.300
  [Host]     : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT
  Job-BJQIPU : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT

Runtime=.NET 6.0  MaxIterationCount=200

Note: The performance figures below are as a guide only. Different systems and configurations can drastically change performance results.

Sequential In-Memory Caching

MethodMeanErrorStdDevOp/sRatioRatioSDGen 0Allocated
IntelligentCache_MemoryCache177.1 ns3.43 ns3.36 ns5,647,113.90.780.020.027988 B
CacheTower_MemoryCacheLayer226.5 ns4.35 ns4.28 ns4,415,623.11.000.000.022972 B
CacheManager_MicrosoftMemoryCache263.9 ns5.12 ns5.26 ns3,789,315.31.160.030.027788 B
FusionCache_MemoryProvider295.7 ns5.60 ns5.50 ns3,382,054.71.310.040.1016320 B
LazyCache_MemoryProvider297.3 ns4.90 ns5.45 ns3,363,940.71.310.040.1144360 B
EasyCaching_InMemory301.1 ns5.86 ns7.41 ns3,321,052.21.330.030.0482152 B

Parallel In-Memory Caching

MethodMeanErrorStdDevOp/sRatioRatioSDGen 0Allocated
IntelligentCache_MemoryCache66.12 us0.479 us0.425 us15,124.80.890.0129.296989 KB
CacheTower_MemoryCacheLayer74.29 us1.292 us1.208 us13,460.51.000.000.97663 KB
CacheManager_MicrosoftMemoryCache93.83 us0.639 us0.566 us10,657.61.270.0229.296989 KB
EasyCaching_InMemory119.71 us1.501 us1.404 us8,353.71.610.0249.9268151 KB
FusionCache_MemoryProvider132.27 us0.775 us0.605 us7,560.21.790.02104.2480316 KB
LazyCache_MemoryProvider917.56 us16.636 us15.561 us1,089.912.350.14118.1641356 KB

Sequential Redis Caching

MethodMeanErrorStdDevOp/sRatioGen 0Gen 1Gen 2Allocated
CacheManager_Redis134.7 us0.72 us0.67 us7,425.30.840.7324--2376 B
IntelligentCache_Redis156.2 us0.91 us0.85 us6,403.40.970.9766--3456 B
EasyCaching_Redis158.1 us0.50 us0.47 us6,326.30.990.2441--1144 B
CacheTower_RedisCacheLayer160.3 us0.47 us0.44 us6,238.41.000.2441--936 B

Parallel Redis Caching

MethodMeanErrorStdDevOp/sRatioRatioSDGen 0Gen 1Gen 2Allocated
CacheTower_RedisCacheLayer413.2 us9.73 us40.90 us2,420.01.000.0024.41419.76561.9531110.38 KB
EasyCaching_Redis452.3 us8.99 us31.63 us2,211.01.110.1322.46099.76562.9297108.74 KB
IntelligentCache_Redis506.8 us10.02 us25.85 us1,973.11.260.1572.265623.92583.9063332.72 KB
CacheManager_Redis2,999.1 us52.07 us46.16 us333.47.940.8082.0313--241.57 KB

File Caching

MethodMeanErrorStdDevOp/sRatioRatioSDGen 0Gen 1Allocated
CacheTower_FileCacheLayer_SystemTextJson333.9 us6.40 us8.32 us2,994.50.990.030.97660.48833 KB
CacheTower_FileCacheLayer_Protobuf337.1 us6.71 us7.45 us2,966.50.990.030.97660.48833 KB
CacheTower_FileCacheLayer_NewtonsoftJson340.1 us3.43 us3.21 us2,940.51.000.002.92971.46489 KB
EasyCaching_Disk359.7 us5.32 us4.97 us2,780.41.060.021.4648-5 KB