Sha256: 8cf4000ebc4ec38f6d089201294b95e339528e9a96b6d2babd08482b09cbbdc7

Contents?: true

Size: 488 Bytes

Versions: 11

Compression:

Stored size: 488 Bytes

Contents

#!/usr/bin/env ruby

if ARGV.empty?
  puts "Usage: benchmark times 'Article.expensive_method' 'Article.another_expensive_method' ..."
  exit 
end

require File.dirname(__FILE__) + '/../config/environment'
require 'benchmark'
include Benchmark

# Don't include compilation in the benchmark
ARGV[1..-1].each { |expression| eval(expression) }

bm(6) do |x|
  ARGV[1..-1].each_with_index do |expression, idx|
    x.report("##{idx + 1}") { ARGV[0].to_i.times { eval(expression) } }
  end
end 

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nitro-0.41.0 proto/script/benchmark
nitro-0.24.0 proto/script/benchmark
nitro-0.25.0 proto/script/benchmark
nitro-0.26.0 proto/script/benchmark
nitro-0.23.0 proto/script/benchmark
nitro-0.28.0 proto/script/benchmark
nitro-0.29.0 proto/script/benchmark
nitro-0.27.0 proto/script/benchmark
nitro-0.30.0 proto/script/benchmark
nitro-0.31.0 proto/script/benchmark
nitro-0.40.0 proto/script/benchmark