Skip to content

Instantly share code, notes, and snippets.

@mdarby
Created November 20, 2008 17:10
Show Gist options
  • Save mdarby/27108 to your computer and use it in GitHub Desktop.
Save mdarby/27108 to your computer and use it in GitHub Desktop.
>> require 'benchmark'
=> []
>> n = 1000
=> 1000
>> Benchmark.bm do |x|
> x.report{User.find(:first, :order => "rand()")}
>> x.report{User.random}
>> end
user system total real
0.000000 0.000000 0.000000 ( 0.007087)
0.000000 0.000000 0.000000 ( 0.004731)
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment