Commit 1fe202d6c05bb67b6fe443e30db721288b14904a
1 parent
59a7fe3e
Exists in
master
and in
18 other branches
Better benchmark [skip ci]
Showing
1 changed file
with
7 additions
and
1 deletions
Show diff stats
benchmark/search.rb
... | ... | @@ -33,6 +33,12 @@ end |
33 | 33 | |
34 | 34 | # Product.reindex |
35 | 35 | |
36 | +query = Product.search("product", fields: [:name], where: {color: "red", store_id: 5}, limit: 10000, load: false, execute: false) | |
37 | + | |
38 | +require "pp" | |
39 | +pp query.body.as_json | |
40 | +puts | |
41 | + | |
36 | 42 | Benchmark.ips do |x| |
37 | - x.report { Product.search("product", fields: [:name], where: {color: "red", store_id: 5}, load: false) } | |
43 | + x.report { query.dup.execute } | |
38 | 44 | end | ... | ... |