Sha256: e7f12b99505f8f62a074f0682910e8d9743e0b2edece298bb5c70c18c5674fd7

Contents?: true

Size: 496 Bytes

Versions: 42

Compression:

Stored size: 496 Bytes

Contents

if [nil, "-h", "--help"].include?(ARGV.first)
  puts "Usage: rails benchmarker [times] 'Person.expensive_way' 'Person.another_expensive_way' ..."
  exit 1
end

begin
  N = Integer(ARGV.first)
  ARGV.shift
rescue ArgumentError
  N = 1
end

require 'benchmark'
include Benchmark

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

bm(6) do |x|
  ARGV.each_with_index do |expression, idx|
    x.report("##{idx + 1}") { N.times { eval(expression) } }
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
railties-3.0.8.rc4 lib/rails/commands/benchmarker.rb
railties-3.0.8.rc2 lib/rails/commands/benchmarker.rb
railties-3.0.8.rc1 lib/rails/commands/benchmarker.rb
railties-3.0.7 lib/rails/commands/benchmarker.rb
railties-3.0.7.rc2 lib/rails/commands/benchmarker.rb
railties-3.0.7.rc1 lib/rails/commands/benchmarker.rb
railties-3.0.6 lib/rails/commands/benchmarker.rb
railties-3.0.6.rc2 lib/rails/commands/benchmarker.rb
railties-3.0.6.rc1 lib/rails/commands/benchmarker.rb
railties-3.0.5 lib/rails/commands/benchmarker.rb
railties-3.0.5.rc1 lib/rails/commands/benchmarker.rb
railties-3.0.4 lib/rails/commands/benchmarker.rb
railties-3.0.4.rc1 lib/rails/commands/benchmarker.rb
railties-3.0.3 lib/rails/commands/benchmarker.rb
railties-3.0.2 lib/rails/commands/benchmarker.rb
railties-3.0.1 lib/rails/commands/benchmarker.rb
railties-3.0.0 lib/rails/commands/benchmarker.rb
railties-3.0.0.rc2 lib/rails/commands/benchmarker.rb
railties-3.0.0.rc lib/rails/commands/benchmarker.rb
railties-3.0.0.beta4 lib/rails/commands/benchmarker.rb