Compare with Nokogiri in the HTML parser bench

This commit is contained in:
Yorick Peterse 2015-05-21 20:59:48 +02:00
parent 1d88b063ac
commit 73855e6428
1 changed files with 10 additions and 2 deletions

View File

@ -1,9 +1,17 @@
require_relative '../../benchmark_helper' require_relative '../../benchmark_helper'
require 'nokogiri'
html = read_html html = read_html
Benchmark.ips do |bench| Benchmark.ips do |bench|
bench.report 'parse HTML' do bench.report 'Oga' do
Oga::HTML::Parser.new(html).parse Oga.parse_html(html)
end end
bench.report 'Nokogiri' do
Nokogiri::HTML(html)
end
bench.compare!
end end