Added extra benchmarks for lexing large inputs.

This commit is contained in:
Yorick Peterse 2014-03-23 12:46:04 +01:00
parent 0e9d9b844c
commit 4b914b3d6f
3 changed files with 4518 additions and 0 deletions

4496
benchmark/fixtures/hrs.html Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

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