Permalink
Browse files

benchmark for 1000 posts

  • Loading branch information...
1 parent 82b29c2 commit 592b1db96bd6781fc68284ee0386abcb7a749213 @flyerhzm committed Jan 20, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 benchmark/benchmark.rb
View
8 benchmark/benchmark.rb
@@ -55,4 +55,12 @@ class Post
bm.report("Finding 100 posts with person, with eager loading") do
Post.limit(100).includes(:person).each { |p| p.person.name }
end
+
+ bm.report("Finding 1000 posts with person, without eager loading") do
+ Post.limit(1000).each { |p| p.person.name }
+ end
+
+ bm.report("Finding 1000 posts with person, with eager loading") do
+ Post.limit(1000).includes(:person).each { |p| p.person.name }
+ end
end

0 comments on commit 592b1db

Please sign in to comment.