Sha256: 608df85e517a97bc5e9b65deb36a806d1fe3d1b7ef78100efd749b46f4274dd0
Contents?: true
Size: 477 Bytes
Versions: 9
Compression:
Stored size: 477 Bytes
Contents
#!/usr/bin/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
9 entries across 9 versions & 2 rubygems