From 46f3ec9df5e2ed30d25df2773702e78785154dd2 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 19 Aug 2015 13:34:41 +0200 Subject: [PATCH] Configurable samples in the concurrent xpath bench --- benchmark/xpath/evaluator/concurrent_time_bench.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/benchmark/xpath/evaluator/concurrent_time_bench.rb b/benchmark/xpath/evaluator/concurrent_time_bench.rb index 96a0bcf..5360397 100644 --- a/benchmark/xpath/evaluator/concurrent_time_bench.rb +++ b/benchmark/xpath/evaluator/concurrent_time_bench.rb @@ -12,6 +12,7 @@ stop = false threads = [] thread_count = ENV['THREADS'] ? ENV['THREADS'].to_i : 5 +sample_size = ENV['SAMPLES'] ? ENV['SAMPLES'].to_i : 10 trap 'INT' do stop = true @@ -29,7 +30,7 @@ thread_count.times.each do oga_doc = documents.pop evaluator = Oga::XPath::Evaluator.new(oga_doc) - 10.times do + sample_size.times do break if stop output << Benchmark.measure { evaluator.evaluate_ast(xpath_ast) }