diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-07-09 10:40:37 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-07-09 10:40:37 -0700 |
commit | 8563dd4bb03a12bc41a7bf9b3e1ab4865a2a0110 (patch) | |
tree | 3548b0d9446ae45e68894129330c090172c1bffa /lib/ffi_yajl/benchmark/encode.rb | |
parent | 6d427a893b28ee71ddcdbb3a6cd64cd01c7a690f (diff) | |
parent | ba9c90591239f0dbc082df70d9785e082a737e29 (diff) | |
download | ffi-yajl-8563dd4bb03a12bc41a7bf9b3e1ab4865a2a0110.tar.gz |
Merge pull request #66 from chef/lcg/rubocop
Lcg/rubocop
Diffstat (limited to 'lib/ffi_yajl/benchmark/encode.rb')
-rw-r--r-- | lib/ffi_yajl/benchmark/encode.rb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/ffi_yajl/benchmark/encode.rb b/lib/ffi_yajl/benchmark/encode.rb index d3f969c..eda4fe7 100644 --- a/lib/ffi_yajl/benchmark/encode.rb +++ b/lib/ffi_yajl/benchmark/encode.rb @@ -42,16 +42,14 @@ end module FFI_Yajl class Benchmark class Encode - def run - #filename = ARGV[0] || 'benchmark/subjects/ohai.json' + # filename = ARGV[0] || 'benchmark/subjects/ohai.json' filename = File.expand_path(File.join(File.dirname(__FILE__), "subjects", "ohai.json")) hash = File.open(filename, 'rb') { |f| FFI_Yajl::Parser.parse(f.read) } times = ARGV[1] ? ARGV[1].to_i : 1000 puts "Starting benchmark encoding #{filename} #{times} times\n\n" ::Benchmark.bmbm { |x| - x.report("FFI_Yajl::Encoder.encode (to a String)") { times.times { output = FFI_Yajl::Encoder.encode(hash) @@ -125,16 +123,15 @@ module FFI_Yajl } end end -# if defined?(ActiveSupport::JSON) -# x.report("ActiveSupport::JSON.encode") { -# times.times { -# ActiveSupport::JSON.encode(hash) -# } -# } -# end + # if defined?(ActiveSupport::JSON) + # x.report("ActiveSupport::JSON.encode") { + # times.times { + # ActiveSupport::JSON.encode(hash) + # } + # } + # end } end end end - end |