Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Disable garbage collector during benchmarks

  • Loading branch information...
commit aa3159d99fde40ef18729882da14e2af7b5fc748 1 parent 7b041e5
@Xinok authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  benchsort.d
View
3  benchsort.d
@@ -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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.