Skip to content

Commit a70a1db

Browse files
committed
add user query benchmarks
1 parent 82439ba commit a70a1db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/tasks/benchmark.rake

+5
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ end
2525
task :benchmark => :environment do
2626
benchmark_query "5 latest posts", Post.latest.limit(5)
2727
benchmark_query "5 latest published posts", Post.published.latest.limit(5)
28+
29+
user = User.find(rand(1000) + 1)
30+
benchmark_query "Posts for a user", user.posts
31+
benchmark_query "Published posts for a user", user.posts.published
32+
benchmark_query "5 latest published posts for a user", user.posts.published.latest.limit(5)
2833
end

0 commit comments

Comments
 (0)