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.
This commit is contained in:
parent
ad26446a5f
commit
3bb67ddf28
|
@ -0,0 +1,10 @@
|
|||
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
|
Loading…
Reference in New Issue