Skip to content

Instantly share code, notes, and snippets.

@xoofx
Last active May 25, 2016 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xoofx/c0508e8fc4a91cb00a1141848eea8371 to your computer and use it in GitHub Desktop.
Save xoofx/c0508e8fc4a91cb00a1141848eea8371 to your computer and use it in GitHub Desktop.
Hardcoded patch for BenchmarkDotNet to have fixed GC results in SingleRun mode (only working for Markdig benchmarks env)
var config = ManualConfig.Create(DefaultConfig.Instance);
var gcDiagnoser = new MemoryDiagnoser();
config.Add(new Job { Mode = Mode.SingleRun, LaunchCount = 2, WarmupCount = 2, TargetCount = 10 });
config.Add(gcDiagnoser);
_________________________________ Patch for BenchMarkDotNet to have precise GC:
diff --git a/BenchmarkDotNet/Running/MethodInvoker.cs b/BenchmarkDotNet/Running/MethodInvoker.cs
index e8d8de5..6a46aa2 100644
--- a/BenchmarkDotNet/Running/MethodInvoker.cs
+++ b/BenchmarkDotNet/Running/MethodInvoker.cs
@@ -89,7 +89,7 @@ namespace BenchmarkDotNet.Running
private void Invoke(IJob job, Func<MultiInvokeInput, Measurement> multiInvoke)
{
- long invokeCount = 1;
+ long invokeCount = 64;
IList<Measurement> idle = null;
if (job.Mode == Mode.Throughput)
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment