Sha256: a7c96e04d15237792926c33d24de40f00b422dc03cb06c413830460f5ea95d69

Contents?: true

Size: 795 Bytes

Versions: 9

Compression:

Stored size: 795 Bytes

Contents

#!/usr/bin/env jruby
$:.unshift File.expand_path('../../lib', __FILE__)

require 'traject/command_line'

require 'benchmark'

unless ARGV.size >= 2
  STDERR.puts "\n     Benchmark two (or more) different config files with both 0 and 3 threads against the given marc file\n"
  STDERR.puts "\n     Usage:"
  STDERR.puts "         jruby --server bench.rb config1.rb config2.rb [...configN.rb] filename.mrc\n\n"
  exit
end

filename = ARGV.pop
config_files = ARGV

puts RUBY_DESCRIPTION
Benchmark.bmbm do |x|
  [0, 3].each do |threads|
    config_files.each do |cf|
      x.report("#{cf} (#{threads})") do
        cmdline = Traject::CommandLine.new(["-c", cf, '-s', 'log.file=bench.log', '-s', "processing_thread_pool=#{threads}", filename])
        cmdline.execute
      end
    end
  end
end

    

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
traject-0.16.0 bench/bench.rb
traject-0.15.0 bench/bench.rb
traject-0.14.1 bench/bench.rb
traject-0.13.2 bench/bench.rb
traject-0.13.1 bench/bench.rb
traject-0.13.0 bench/bench.rb
traject-0.12.0 bench/bench.rb
traject-0.11.0 bench/bench.rb
traject-0.10.0 bench/bench.rb