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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -19,6 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Benchly" Version="0.6.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
Expand Down
2 changes: 2 additions & 0 deletions BitFaster.Caching.Benchmarks/Lfu/LfuJustGetOrAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using BenchmarkDotNet.Jobs;
using BitFaster.Caching.Lfu;
using BitFaster.Caching.Scheduler;
using Benchly;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
Expand All @@ -17,6 +18,7 @@ namespace BitFaster.Caching.Benchmarks
[MemoryDiagnoser(displayGenColumns: false)]
// [HardwareCounters(HardwareCounter.LlcMisses, HardwareCounter.CacheMisses)] // Requires Admin https://adamsitnik.com/Hardware-Counters-Diagnoser/
// [ThreadingDiagnoser] // Requires .NET Core
[BoxPlot(Title = "LFU Read Latency")]
[HideColumns("Job", "Median", "RatioSD", "Alloc Ratio")]
public class LfuJustGetOrAdd
{
Expand Down
2 changes: 2 additions & 0 deletions BitFaster.Caching.Benchmarks/Lfu/SketchFrequency.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

using System.Collections.Generic;
using Benchly;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BitFaster.Caching.Lfu;
Expand All @@ -9,6 +10,7 @@ namespace BitFaster.Caching.Benchmarks.Lfu
[SimpleJob(RuntimeMoniker.Net60)]
[MemoryDiagnoser(displayGenColumns: false)]
[HideColumns("Job", "Median", "RatioSD", "Alloc Ratio")]
[ColumnChart(Title ="Sketch Frequency ({JOB})")]
public class SketchFrequency
{
const int sketchSize = 1_048_576;
Expand Down
5 changes: 3 additions & 2 deletions BitFaster.Caching.Benchmarks/Lru/LruJustGetOrAdd.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BenchmarkDotNet.Attributes;
using Benchly;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Jobs;
using BitFaster.Caching.Lfu;
Expand Down Expand Up @@ -38,6 +39,7 @@ namespace BitFaster.Caching.Benchmarks
// [HardwareCounters(HardwareCounter.LlcMisses, HardwareCounter.CacheMisses)] // Requires Admin https://adamsitnik.com/Hardware-Counters-Diagnoser/
// [ThreadingDiagnoser] // Requires .NET Core
[HideColumns("Job", "Median", "RatioSD", "Alloc Ratio")]
[ColumnChart(Title= "Lookup Latency ({JOB})", Output = OutputMode.PerJob, Colors = "darkslategray,royalblue,royalblue,royalblue,royalblue,royalblue,royalblue,royalblue,#ffbf00,limegreen,indianred,indianred")]
public class LruJustGetOrAdd
{
private static readonly ConcurrentDictionary<int, int> dictionary = new ConcurrentDictionary<int, int>(8, 9, EqualityComparer<int>.Default);
Expand All @@ -55,7 +57,6 @@ public class LruJustGetOrAdd
private static readonly BackgroundThreadScheduler background = new BackgroundThreadScheduler();
private static readonly ConcurrentLfu<int, int> concurrentLfu = new ConcurrentLfu<int, int>(1, 9, background, EqualityComparer<int>.Default);


private static readonly int key = 1;
private static System.Runtime.Caching.MemoryCache memoryCache = System.Runtime.Caching.MemoryCache.Default;

Expand Down