2015-02-13 08:36:24 +00:00
|
|
|
require_relative '../../benchmark_helper'
|
|
|
|
|
|
|
|
css = 'foo bar bar.some_class element#with_id[title="Foo"]'
|
|
|
|
|
|
|
|
Benchmark.ips do |bench|
|
2015-03-22 23:22:59 +00:00
|
|
|
bench.report 'without cache' do
|
2015-02-13 08:36:24 +00:00
|
|
|
Oga::CSS::Parser.new(css).parse
|
|
|
|
end
|
2015-03-22 23:22:59 +00:00
|
|
|
|
|
|
|
bench.report 'with cache' do
|
|
|
|
Oga::CSS::Parser.parse_with_cache(css)
|
|
|
|
end
|
|
|
|
|
|
|
|
bench.compare!
|
2015-02-13 08:36:24 +00:00
|
|
|
end
|