Compare with Nokogiri in the HTML parser bench
This commit is contained in:
parent
1d88b063ac
commit
73855e6428
|
@ -1,9 +1,17 @@
|
|||
require_relative '../../benchmark_helper'
|
||||
|
||||
require 'nokogiri'
|
||||
|
||||
html = read_html
|
||||
|
||||
Benchmark.ips do |bench|
|
||||
bench.report 'parse HTML' do
|
||||
Oga::HTML::Parser.new(html).parse
|
||||
bench.report 'Oga' do
|
||||
Oga.parse_html(html)
|
||||
end
|
||||
|
||||
bench.report 'Nokogiri' do
|
||||
Nokogiri::HTML(html)
|
||||
end
|
||||
|
||||
bench.compare!
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue