[MemoryDiagnoser(false)] public class Benchmarks { private readonly IAppCache _appCache = new CachingService(); private readonly IMemoryCache _memoryCache = new MemoryCache(new MemoryCacheOptions()); [Benchmark] public int GetOrCreate_MemoryCache() => _memoryCache.GetOrCreate("set", _ => 100); [Benchmark] public int GetOrCreate_LazyCache() => _appCache.GetOrAdd("set", _ => 100); }