Skip to content

Instantly share code, notes, and snippets.

@abscondment
Created September 14, 2010 03:59
Show Gist options
  • Save abscondment/578508 to your computer and use it in GitHub Desktop.
Save abscondment/578508 to your computer and use it in GitHub Desktop.
10.times do
r = Restaurant.find(:all, :include => [:cuisines], :conditions => ['id IN (?)', ids])
r.map(&:cuisines).flatten.map(&:id)
end
# benchmarked 10 times
user system total real
5.540000 0.010000 5.550000 ( 5.553716)
5.560000 0.000000 5.560000 ( 5.566566)
5.670000 0.010000 5.680000 ( 5.687871)
5.670000 0.000000 5.670000 ( 5.674870)
5.580000 0.000000 5.580000 ( 5.581576)
5.670000 0.000000 5.670000 ( 5.678692)
5.570000 0.000000 5.570000 ( 5.578353)
5.630000 0.000000 5.630000 ( 5.629657)
5.740000 0.000000 5.740000 ( 5.745029)
5.560000 0.000000 5.560000 ( 5.568952)
# memory diff from baseline IRB for each run [1]
8896, 14608, 14800, 14932, 15024, 15152, 15248, 15300, 15300, 15300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment