diff options
Diffstat (limited to 'bin/ffi-yajl-bench')
-rwxr-xr-x | bin/ffi-yajl-bench | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/ffi-yajl-bench b/bin/ffi-yajl-bench index 13725a0..410c5e0 100755 --- a/bin/ffi-yajl-bench +++ b/bin/ffi-yajl-bench @@ -14,10 +14,21 @@ optparse = OptionParser.new do |o| o.on( '-p', '--profile', 'Run perftools.rb profiling' ) do opts[:profile] = true end + + o.on( '-F', '--ffi', 'Force using FFI' ) do + opts[:ffi] = true + end + + o.on( '-E', '--ext', 'Force using C ext' ) do + opts[:ext] = true + end end optparse.parse! +ENV['FORCE_FFI_YAJL'] = 'ffi' if opts[:ffi] +ENV['FORCE_FFI_YAJL'] = 'ext' if opts[:ext] + if opts[:profile] FFI_Yajl::Benchmark::EncodeProfile.new().run() else |