Added benchmark for descendant-or-self

This commit is contained in:
Yorick Peterse 2014-10-23 01:11:19 +02:00
parent 7ee7f25239
commit 47e4a3aa49
1 changed files with 13 additions and 0 deletions

View File

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