Sha256: 9ce32aad4dd865ccaff3fb93c3ed586aa9d71783ae14cb77be566c382d095cb3

Contents?: true

Size: 481 Bytes

Versions: 26

Compression:

Stored size: 481 Bytes

Contents

#!/usr/bin/env ruby

if ARGV.empty?
  puts "Usage: benchmarker times 'Person.expensive_way' 'Person.another_expensive_way' ..."
  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

26 entries across 26 versions & 1 rubygems

Version Path
typo-5.4.1 script/benchmarker
typo-5.4 script/benchmarker
typo-3.99.0 script/benchmarker
typo-3.99.1 script/benchmarker
typo-3.99.2 script/benchmarker
typo-3.99.3 script/benchmarker
typo-3.99.4 script/benchmarker
typo-4.0.1 script/benchmarker
typo-4.0.0 script/benchmarker
typo-4.0.2 script/benchmarker
typo-4.0.3 script/benchmarker
typo-4.1.1 script/benchmarker
typo-5.0.1 script/benchmarker
typo-4.1 script/benchmarker
typo-5.0.2 script/benchmarker
typo-5.0.3.98.1 script/benchmarker
typo-5.0.3.98 script/benchmarker
typo-5.0 script/benchmarker
typo-5.1.2 script/benchmarker
typo-5.1.1 script/benchmarker