From e985e6fe07a501dc20ae7930c397400b5dce0319 Mon Sep 17 00:00:00 2001 From: Bob Nystrom Date: Wed, 28 Oct 2015 07:45:52 -0700 Subject: [PATCH] Make sure binary_trees_gc actually stresses GC. --- test/benchmark/binary_trees_gc.wren | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/benchmark/binary_trees_gc.wren b/test/benchmark/binary_trees_gc.wren index 46489897..83eb4ffc 100644 --- a/test/benchmark/binary_trees_gc.wren +++ b/test/benchmark/binary_trees_gc.wren @@ -28,7 +28,7 @@ var start = System.clock System.print("stretch tree of depth " + stretchDepth.toString + " check: " + Tree.new(0, stretchDepth).check.toString) -System.gc() +for (i in 1...1000) System.gc() var longLivedTree = Tree.new(0, maxDepth) @@ -47,7 +47,7 @@ while (depth < stretchDepth) { System.print((iterations * 2).toString + " trees of depth " + depth.toString + " check: " + check.toString) - System.gc() + for (i in 1...1000) System.gc() iterations = iterations / 4 depth = depth + 2 @@ -55,6 +55,6 @@ while (depth < stretchDepth) { System.print("long lived tree of depth " + maxDepth.toString + " check: " + longLivedTree.check.toString) -System.gc() +for (i in 1...1000) System.gc() System.print("elapsed: " + (System.clock - start).toString)