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_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
|
||||||
|
|
Loading…
Reference in New Issue