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
21 changes: 21 additions & 0 deletions BitFaster.Caching.ThroughputAnalysis/SizeExec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cls

dotnet BitFaster.Caching.ThroughputAnalysis.dll 1 100
dotnet BitFaster.Caching.ThroughputAnalysis.dll 1 10000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 1 1000000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 1 10000000

dotnet BitFaster.Caching.ThroughputAnalysis.dll 2 1000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 2 100000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 2 10000000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 2 100000000

dotnet BitFaster.Caching.ThroughputAnalysis.dll 3 100
dotnet BitFaster.Caching.ThroughputAnalysis.dll 3 10000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 3 1000000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 3 10000000

dotnet BitFaster.Caching.ThroughputAnalysis.dll 4 100
dotnet BitFaster.Caching.ThroughputAnalysis.dll 4 10000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 4 1000000
dotnet BitFaster.Caching.ThroughputAnalysis.dll 4 10000000
9 changes: 6 additions & 3 deletions BitFaster.Caching.ThroughputAnalysis/ThroughputBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class ThroughputBenchmarkBase
Initialize?.Invoke(cache);

// Warmup a few times before estimating run time
config.Iterations = 10;
config.Iterations = 1;

for (int i = 0; i < warmup; i++)
{
Expand All @@ -46,14 +46,17 @@ public abstract class ThroughputBenchmarkBase
var sw = Stopwatch.StartNew();
Run(Stage.Pilot, 0, threads, config, cache);

valid = sw.Elapsed > TimeSpan.FromMilliseconds(400) ? valid + 1 : 0;
valid = sw.Elapsed > TimeSpan.FromMilliseconds(800) ? valid + 1 : 0;

if (valid > 3)
{
break;
}

config.Iterations = (int)(1.2 * config.Iterations);
if (valid == 0)
{
config.Iterations = config.Iterations < 5 ? config.Iterations + 1 : (int)(1.2 * config.Iterations);
}
}

int runCounter = 0;
Expand Down