Skip to content

Instantly share code, notes, and snippets.

@abscondment
Created September 14, 2010 04:02
Show Gist options
  • Save abscondment/578514 to your computer and use it in GitHub Desktop.
Save abscondment/578514 to your computer and use it in GitHub Desktop.
10.times do
r = Restaurant.find(:all, :conditions => ['id IN (?)', ids])
Restaurant.add_cuisines(r)
r.map(&:cuisines).flatten.map(&:id)
end
# benchmarked 10 times
user system total real
3.070000 0.040000 3.110000 ( 3.148139)
3.040000 0.030000 3.070000 ( 3.133394)
3.060000 0.050000 3.110000 ( 3.160772)
3.050000 0.040000 3.090000 ( 3.178049)
3.100000 0.010000 3.110000 ( 3.169859)
3.070000 0.030000 3.100000 ( 3.174384)
3.120000 0.040000 3.160000 ( 3.259299)
3.120000 0.030000 3.150000 ( 3.238029)
3.100000 0.040000 3.140000 ( 3.241258)
3.060000 0.030000 3.090000 ( 3.135886)
# memory diff from baseline IRB for each run [1]
4388, 10112, 10180, 10252, 10316, 10364, 10408, 10496, 10540, 10472
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment