Added extra benchmarks for lexing large inputs.
This commit is contained in:
parent
0e9d9b844c
commit
4b914b3d6f
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,11 @@
|
||||||
|
require_relative '../../lib/oga'
|
||||||
|
require 'benchmark/ips'
|
||||||
|
|
||||||
|
html = File.read(File.expand_path('../../fixtures/hrs.html', __FILE__))
|
||||||
|
lexer = Oga::Lexer.new(:html => true)
|
||||||
|
|
||||||
|
Benchmark.ips do |bench|
|
||||||
|
bench.report 'lex HTML' do
|
||||||
|
lexer.lex(html)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,11 @@
|
||||||
|
require_relative '../../lib/oga'
|
||||||
|
require 'benchmark'
|
||||||
|
|
||||||
|
html = File.read(File.expand_path('../../fixtures/hrs.html', __FILE__))
|
||||||
|
lexer = Oga::Lexer.new(:html => true)
|
||||||
|
|
||||||
|
Benchmark.bmbm(20) do |bench|
|
||||||
|
bench.report 'lex HTML' do
|
||||||
|
lexer.lex(html)
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue