1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Merge pull request #47 from walf443/fix/benchmark_ext_build_data

make benchmark to more accurate.
This commit is contained in:
Takashi Kokubun 2015-12-12 11:07:24 +09:00
commit bb85aa7c83

View file

@ -9,7 +9,9 @@ require_relative '../utils/benchmark_ips_extension'
h = { 'user' => { id: 1234, name: 'k0kubun' }, book_id: 5432 } h = { 'user' => { id: 1234, name: 'k0kubun' }, book_id: 5432 }
Benchmark.ips do |x| Benchmark.ips do |x|
x.report("Faml::AB.build") { Faml::AttributeBuilder.build("'", true, nil, data: h) } quote = "'"
x.report("Hamlit.build_data") { Hamlit::AttributeBuilder.build_data(true, "'", h) } faml_options = { data: h }
x.report("Faml::AB.build") { Faml::AttributeBuilder.build(quote, true, nil, faml_options) }
x.report("Hamlit.build_data") { Hamlit::AttributeBuilder.build_data(true, quote, h) }
x.compare! x.compare!
end end