Simple benchmarks for the XPath lexer.

This commit is contained in:
Yorick Peterse 2014-06-13 00:49:24 +02:00
parent e75cd0ede8
commit 99615d72f9
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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