Sha256: c91417251503e82305057c5d971cf80f00c3affdf83a792ea6469e004efb0cd3

Contents?: true

Size: 819 Bytes

Versions: 13

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

13 entries across 13 versions & 1 rubygems

Version Path
ffi-yajl-2.6.0-universal-java bin/ffi-yajl-bench
ffi-yajl-2.6.0 bin/ffi-yajl-bench
ffi-yajl-3.0.0-universal-java bin/ffi-yajl-bench
ffi-yajl-3.0.0 bin/ffi-yajl-bench
ffi-yajl-2.5.0-universal-java bin/ffi-yajl-bench
ffi-yajl-2.4.0-universal-java bin/ffi-yajl-bench
ffi-yajl-2.4.0 bin/ffi-yajl-bench
ffi-yajl-2.3.4 bin/ffi-yajl-bench
ffi-yajl-2.3.4-universal-java bin/ffi-yajl-bench
ffi-yajl-2.3.3 bin/ffi-yajl-bench
ffi-yajl-2.3.3-universal-java bin/ffi-yajl-bench
ffi-yajl-2.3.1-universal-java bin/ffi-yajl-bench
ffi-yajl-2.3.1 bin/ffi-yajl-bench