Files
oga/benchmark/xpath/evaluator/simple_bench.rb
T
Yorick Peterse 3bb67ddf28 XPath evaluation bench to test parsing times
This benchmark is simple enough that the overhead of evaluation is not
far greater than parsing. This makes it suitable for benchmarking the
performance increase of caching XPath ASTs.
2015-03-22 18:31:42 +01:00

11 lines
198 B
Ruby

require_relative '../../benchmark_helper'
document = Oga.parse_xml('<root></root>')
query = 'root'
Benchmark.ips do |bench|
bench.report(query.inspect) do
document.xpath(query)
end
end