Commit 9010f64b27a8d112b8d9cbc8d9cfbc1d5e458fdc
1 parent
9f8d39ef
Exists in
master
and in
19 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,6 +33,12 @@ end | ||
33 | 33 | ||
34 | # Product.reindex | 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 | Benchmark.ips do |x| | 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 | end | 44 | end |