diff options
Diffstat (limited to 'lib/ffi_yajl/benchmark/parse.rb')
-rw-r--r-- | lib/ffi_yajl/benchmark/parse.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/ffi_yajl/benchmark/parse.rb b/lib/ffi_yajl/benchmark/parse.rb index e091343..02ad740 100644 --- a/lib/ffi_yajl/benchmark/parse.rb +++ b/lib/ffi_yajl/benchmark/parse.rb @@ -28,6 +28,10 @@ begin require 'active_support' rescue LoadError end +begin + require 'oj' +rescue LoadError +end class FFI_Yajl::Benchmark::Parse @@ -79,6 +83,15 @@ class FFI_Yajl::Benchmark::Parse } } end + if defined?(Oj) + x.report { + puts "Oj.load" + times.times { + json.rewind + Oj.load(json.read) + } + } + end if defined?(JSON) x.report { puts "JSON.parse" |