Configurable samples in the concurrent xpath bench
This commit is contained in:
parent
399403c290
commit
46f3ec9df5
|
@ -12,6 +12,7 @@ stop = false
|
||||||
threads = []
|
threads = []
|
||||||
|
|
||||||
thread_count = ENV['THREADS'] ? ENV['THREADS'].to_i : 5
|
thread_count = ENV['THREADS'] ? ENV['THREADS'].to_i : 5
|
||||||
|
sample_size = ENV['SAMPLES'] ? ENV['SAMPLES'].to_i : 10
|
||||||
|
|
||||||
trap 'INT' do
|
trap 'INT' do
|
||||||
stop = true
|
stop = true
|
||||||
|
@ -29,7 +30,7 @@ thread_count.times.each do
|
||||||
oga_doc = documents.pop
|
oga_doc = documents.pop
|
||||||
evaluator = Oga::XPath::Evaluator.new(oga_doc)
|
evaluator = Oga::XPath::Evaluator.new(oga_doc)
|
||||||
|
|
||||||
10.times do
|
sample_size.times do
|
||||||
break if stop
|
break if stop
|
||||||
|
|
||||||
output << Benchmark.measure { evaluator.evaluate_ast(xpath_ast) }
|
output << Benchmark.measure { evaluator.evaluate_ast(xpath_ast) }
|
||||||
|
|
Loading…
Reference in New Issue