Skip to content

Instantly share code, notes, and snippets.

@dhoss
Forked from logankoester/simple_ar_benchmark.rb
Last active August 29, 2015 14:02
Show Gist options
  • Save dhoss/3effe09fef0386cb3aa0 to your computer and use it in GitHub Desktop.
Save dhoss/3effe09fef0386cb3aa0 to your computer and use it in GitHub Desktop.
# Give it two procs to compare
def bm(o, n)
reload!
puts "Running 10 times"
Benchmark.bmbm(10) do |x|
x.report('Old Query:') { @olr = o.call }
x.report('New Query:') { @nr = n.call }
end
reload!
puts 'Old Result:'
table(@olr)
puts 'New Result'
table(@nr)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment