Skip to content

Instantly share code, notes, and snippets.

@goshacmd
Created February 7, 2013 21:47
Show Gist options
  • Save goshacmd/4734548 to your computer and use it in GitHub Desktop.
Save goshacmd/4734548 to your computer and use it in GitHub Desktop.
$ cat bm.rb
require './env'
Benchmark.bm do |x|
x.report('block') { OrderEvent.all.limit(100_000).map(&:total) }
x.report('sym') { OrderEvent.all.limit(100_000).map(:total) }
end
$ ruby bm.rb
user system total real
block 10.490000 0.240000 10.730000 ( 10.810376)
sym 2.490000 0.060000 2.550000 ( 2.759671)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment