From 0f7f095149b90b41478f6d1cc3e5452b3116c909 Mon Sep 17 00:00:00 2001 From: "Keiji, Yoshimi" Date: Sat, 12 Dec 2015 10:40:14 +0900 Subject: [PATCH] make benchmark to more accurate. --- benchmark/ext/build_data.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmark/ext/build_data.rb b/benchmark/ext/build_data.rb index 285ce896..5d47242b 100755 --- a/benchmark/ext/build_data.rb +++ b/benchmark/ext/build_data.rb @@ -9,7 +9,9 @@ require_relative '../utils/benchmark_ips_extension' h = { 'user' => { id: 1234, name: 'k0kubun' }, book_id: 5432 } Benchmark.ips do |x| - x.report("Faml::AB.build") { Faml::AttributeBuilder.build("'", true, nil, data: h) } - x.report("Hamlit.build_data") { Hamlit::AttributeBuilder.build_data(true, "'", h) } + quote = "'" + 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! end