diff --git a/benchmark/xpath/evaluator/descendant_or_self_bench.rb b/benchmark/xpath/evaluator/descendant_or_self_bench.rb new file mode 100644 index 0000000..b6f0f65 --- /dev/null +++ b/benchmark/xpath/evaluator/descendant_or_self_bench.rb @@ -0,0 +1,13 @@ +require_relative '../../benchmark_helper' + +document = Oga.parse_html(read_html) + +Benchmark.ips do |bench| + bench.report 'short form' do + document.xpath('//meta') + end + + bench.report 'long form' do + document.xpath('descendant-or-self::meta') + end +end