Skip to content

Commit

Permalink
Reset static state per iteration for k-nucleotide-9 (dotnet#14081)
Browse files Browse the repository at this point in the history
Otherwise iterations keep getting slower and slower.

Also bump inner iteration count to 10 to restore the nominal one second
duration per iteration.
  • Loading branch information
AndyAyersMS authored Sep 20, 2017
1 parent 5b1b199 commit fd1000c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public static int Main(string[] args)
return (ok ? 100 : -1);
}

[Benchmark(InnerIterationCount = 1)]
[Benchmark(InnerIterationCount = 10)]
public static void RunBench()
{
var helpers = new TestHarnessHelpers(bigInput: true);
Expand All @@ -281,6 +281,11 @@ public static void RunBench()

static bool Bench(TestHarnessHelpers helpers, bool verbose)
{
// Reset static state
threeBlocks.Clear();
threeStart = 0;
threeEnd = 0;

tonum['c'] = 1; tonum['C'] = 1;
tonum['g'] = 2; tonum['G'] = 2;
tonum['t'] = 3; tonum['T'] = 3;
Expand Down

0 comments on commit fd1000c

Please sign in to comment.