2014-06-23 18:50:07 +00:00
|
|
|
require_relative '../../benchmark_helper'
|
|
|
|
|
|
|
|
xpath = '/wikimedia/projects/project[@name="Wikipedia"]/editions/edition/text()'
|
|
|
|
|
|
|
|
Benchmark.ips do |bench|
|
2015-03-22 23:22:59 +00:00
|
|
|
bench.report 'without cache' do
|
2014-06-23 18:50:07 +00:00
|
|
|
Oga::XPath::Parser.new(xpath).parse
|
|
|
|
end
|
2015-03-22 23:22:59 +00:00
|
|
|
|
|
|
|
bench.report 'with cache' do
|
|
|
|
Oga::XPath::Parser.parse_with_cache(xpath)
|
|
|
|
end
|
|
|
|
|
|
|
|
bench.compare!
|
2014-06-23 18:50:07 +00:00
|
|
|
end
|