Skip to content

Commit

Permalink
Merge pull request #14 from pocke/Fix_the_benchmark_script_to_call__t…
Browse files Browse the repository at this point in the history
…o_a_

Fix the benchmark script to call `to_a`
  • Loading branch information
pocke authored Mar 16, 2024
2 parents 830d020 + 2ddf650 commit 827aff1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions benchmark/select_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Post < ActiveRecord::Base
end

Benchmark.ips do |x|
x.report("without where") { Post.all.to_sql }
x.report('with single condition') { Post.where(title: 'title1').to_sql }
x.report('with multiple condition') { Post.where(state: 'draft', comments_count: ..42, likes_count: ..43).to_sql }
x.report("without where") { Post.all.to_a }
x.report('with single condition') { Post.where(title: 'title1').to_a }
x.report('with multiple condition') { Post.where(state: 'draft', comments_count: ..42, likes_count: ..43).to_a }
end

0 comments on commit 827aff1

Please sign in to comment.