Sha256: 8812610b155b6719b0fb0b209a439b5f9f8af3345d221ebf5144936010a7fc6d

Contents?: true

Size: 824 Bytes

Versions: 26

Compression:

Stored size: 824 Bytes

Contents

#!/usr/bin/env ruby


$: << 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

26 entries across 26 versions & 1 rubygems

Version Path
ffi-yajl-2.2.0 bin/ffi-yajl-bench
ffi-yajl-2.2.0-universal-java bin/ffi-yajl-bench
ffi-yajl-2.1.0-universal-java bin/ffi-yajl-bench
ffi-yajl-2.1.0 bin/ffi-yajl-bench
ffi-yajl-2.0.0-universal-java bin/ffi-yajl-bench
ffi-yajl-2.0.0 bin/ffi-yajl-bench
ffi-yajl-1.4.0-universal-java bin/ffi-yajl-bench
ffi-yajl-1.4.0 bin/ffi-yajl-bench
ffi-yajl-1.3.1-universal-java bin/ffi-yajl-bench
ffi-yajl-1.3.1 bin/ffi-yajl-bench
ffi-yajl-1.3.0-universal-java bin/ffi-yajl-bench
ffi-yajl-1.3.0 bin/ffi-yajl-bench
ffi-yajl-1.2.0-universal-java bin/ffi-yajl-bench
ffi-yajl-1.2.0 bin/ffi-yajl-bench
ffi-yajl-1.1.0-universal-java bin/ffi-yajl-bench
ffi-yajl-1.1.0 bin/ffi-yajl-bench
ffi-yajl-1.0.2-universal-java bin/ffi-yajl-bench
ffi-yajl-1.0.2 bin/ffi-yajl-bench
ffi-yajl-1.0.1-universal-java bin/ffi-yajl-bench
ffi-yajl-1.0.1 bin/ffi-yajl-bench