Commit fdfbf3712d21c1203b153dd941c9f5d8f120f857
1 parent
7b13cf2e
Exists in
master
and in
20 other branches
Updated benchmarking [skip ci]
Showing
2 changed files
with
11 additions
and
2 deletions
Show diff stats
benchmark/Gemfile
benchmark/benchmark.rb
... | ... | @@ -15,9 +15,17 @@ end |
15 | 15 | |
16 | 16 | class Product < ActiveRecord::Base |
17 | 17 | searchkick batch_size: 100 |
18 | + | |
19 | + def search_data | |
20 | + { | |
21 | + name: name, | |
22 | + color: color, | |
23 | + store_id: store_id | |
24 | + } | |
25 | + end | |
18 | 26 | end |
19 | 27 | |
20 | -Product.import ["name", "color", "store_id"], 10000.times.map { |i| ["Product #{i}", ["red", "blue"].sample, rand(10)] } | |
28 | +Product.import ["name", "color", "store_id"], 20000.times.map { |i| ["Product #{i}", ["red", "blue"].sample, rand(10)] } | |
21 | 29 | |
22 | 30 | puts "Imported" |
23 | 31 | |
... | ... | @@ -42,7 +50,7 @@ puts Product.searchkick_index.total_docs |
42 | 50 | |
43 | 51 | if result |
44 | 52 | printer = RubyProf::GraphPrinter.new(result) |
45 | - printer.print(STDOUT, min_percent: 2) | |
53 | + printer.print(STDOUT, min_percent: 5) | |
46 | 54 | end |
47 | 55 | |
48 | 56 | # puts Product.count | ... | ... |