Configurable samples in the concurrent xpath bench

This commit is contained in:
Yorick Peterse committed 2015-08-19 13:34:41 +02:00
1 parent 399403c290
commit 46f3ec9df5
1 file changed
+2 -1
@@ -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) }