Sha256: 7ca8e933d5a45672fc1a2e4eac107c0b625b2398670ddf86b92f6abdf6511844

Contents?: true

Size: 819 Bytes

Versions: 8

Compression:

Stored size: 819 Bytes

Contents

#!/usr/bin/env ruby

$LOAD_PATH << File.expand_path(File.join(File.dirname( File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__ ), "../lib"))

require 'optparse'
require 'ffi_yajl/benchmark'

opts = {}
optparse = OptionParser.new do |o|
  o.banner = "Usage: ffi-yajl-bench"

  opts[:profile] = false
  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::ParseProfileRubyProf.new.run
else
  FFI_Yajl::Benchmark::Parse.new.run
  FFI_Yajl::Benchmark::Encode.new.run
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ffi-yajl-2.3.0-universal-java bin/ffi-yajl-bench
ffi-yajl-2.3.0 bin/ffi-yajl-bench
ffi-yajl-2.2.3-universal-java bin/ffi-yajl-bench
ffi-yajl-2.2.3 bin/ffi-yajl-bench
ffi-yajl-2.2.2 bin/ffi-yajl-bench
ffi-yajl-2.2.2-universal-java bin/ffi-yajl-bench
ffi-yajl-2.2.1 bin/ffi-yajl-bench
ffi-yajl-2.2.1-universal-java bin/ffi-yajl-bench