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