Permalink
Browse files

Disable garbage collector during benchmarks

  • Loading branch information...
Xinok committed Jul 26, 2012
1 parent 7b041e5 commit aa3159d99fde40ef18729882da14e2af7b5fc748
Showing with 3 additions and 0 deletions.
  1. +3 −0 benchsort.d
View
@@ -1,5 +1,6 @@
module benchsort;
import std.stdio, std.random, std.datetime, std.string, std.range, std.algorithm, std.md5;
+import core.memory;
import combsort, forwardsort, heapsort, insertionsort, mergesort, shellsort, stablequicksort, stablesort, timsort, unstablesort;
void main()
@@ -30,11 +31,13 @@ void main()
static ulong bench(lazy void run)
{
+ GC.disable();
copy[] = base[];
StopWatch sw;
sw.start();
run();
sw.stop();
+ GC.enable();
return sw.peek.msecs;
}

0 comments on commit aa3159d

Please sign in to comment.