Commit 6ef1619d2ba8fce74e6b8d0076e3f7fb3e84b804
1 parent
81f73ff7
Exists in
master
and in
19 other branches
Updated benchmark [skip ci]
Showing
1 changed file
with
8 additions
and
6 deletions
Show diff stats
benchmark/benchmark.rb
@@ -49,18 +49,20 @@ result = nil | @@ -49,18 +49,20 @@ result = nil | ||
49 | report = nil | 49 | report = nil |
50 | stats = nil | 50 | stats = nil |
51 | 51 | ||
52 | -# p GetProcessMem.new.mb | ||
53 | - | ||
54 | Product.searchkick_index.delete rescue nil | 52 | Product.searchkick_index.delete rescue nil |
55 | 53 | ||
54 | +GC.start | ||
55 | +GC.disable | ||
56 | +start_mem = GetProcessMem.new.mb | ||
57 | + | ||
56 | time = | 58 | time = |
57 | Benchmark.realtime do | 59 | Benchmark.realtime do |
58 | # result = RubyProf.profile do | 60 | # result = RubyProf.profile do |
59 | - report = MemoryProfiler.report do | 61 | + # report = MemoryProfiler.report do |
60 | # stats = AllocationStats.trace do | 62 | # stats = AllocationStats.trace do |
61 | reindex = Product.reindex #(async: true) | 63 | reindex = Product.reindex #(async: true) |
62 | - p reindex | ||
63 | - end | 64 | + # p reindex |
65 | + # end | ||
64 | 66 | ||
65 | # 60.times do |i| | 67 | # 60.times do |i| |
66 | # if reindex.is_a?(Hash) | 68 | # if reindex.is_a?(Hash) |
@@ -78,7 +80,7 @@ time = | @@ -78,7 +80,7 @@ time = | ||
78 | # end | 80 | # end |
79 | end | 81 | end |
80 | 82 | ||
81 | -# p GetProcessMem.new.mb | 83 | +p GetProcessMem.new.mb - start_mem |
82 | 84 | ||
83 | puts time.round(1) | 85 | puts time.round(1) |
84 | 86 |