From 47e4a3aa49d739b9ada35db081f375c6e51a3a64 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Thu, 23 Oct 2014 01:11:19 +0200 Subject: [PATCH] Added benchmark for descendant-or-self --- .../xpath/evaluator/descendant_or_self_bench.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 benchmark/xpath/evaluator/descendant_or_self_bench.rb 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