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