diff --git a/benchmark/xpath/lexer/simple.rb b/benchmark/xpath/lexer/simple.rb new file mode 100644 index 0000000..f0f6734 --- /dev/null +++ b/benchmark/xpath/lexer/simple.rb @@ -0,0 +1,9 @@ +require_relative '../../benchmark_helper' + +xpath = '/wikimedia/projects/project[@name="Wikipedia"]/editions/edition/text()' + +Benchmark.ips do |bench| + bench.report 'simple XPath' do + Oga::XPath::Lexer.new(xpath).lex + end +end diff --git a/benchmark/xpath/lexer/simple_time.rb b/benchmark/xpath/lexer/simple_time.rb new file mode 100644 index 0000000..84cb694 --- /dev/null +++ b/benchmark/xpath/lexer/simple_time.rb @@ -0,0 +1,9 @@ +require_relative '../../benchmark_helper' + +xpath = '/wikimedia/projects/project[@name="Wikipedia"]/editions/edition/text()' + +Benchmark.bmbm(10) do |bench| + bench.report 'simple XPath' do + Oga::XPath::Lexer.new(xpath).lex + end +end