From e24c040f01c78fdb0e2ecacbeac897110c7a0ec0 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sun, 15 Dec 2013 00:54:35 +0700 Subject: [PATCH] Start GC before benchmarking --- lib/workbench/benchmark.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/workbench/benchmark.rb b/lib/workbench/benchmark.rb index f74b8c1..648aa48 100644 --- a/lib/workbench/benchmark.rb +++ b/lib/workbench/benchmark.rb @@ -12,10 +12,11 @@ module Workbench def initialize args, &block puts '#' * TERMINAL_WIDTH puts '##' + args[:title].center(TERMINAL_WIDTH - 4) + '##' - puts '#' * TERMINAL_WIDTH + puts '#' * TERMINAL_WIDTH ::Benchmark.bm(TERMINAL_WIDTH - BM_WIDTH) do |benchmark| @@engines.each do |name, attrs| + GC.start benchmark.report(name) do args[:loops].times{ yield(name, attrs) } end