Commit 160ae11feb1b29397f7ad36348bd3dd9e1c71bfe

Authored by Andrew Kane
1 parent ffaf8284

Better benchmark [skip ci]

Showing 1 changed file with 6 additions and 4 deletions   Show diff stats
benchmark/benchmark.rb
@@ -23,7 +23,7 @@ puts "Imported" @@ -23,7 +23,7 @@ puts "Imported"
23 23
24 result = nil 24 result = nil
25 25
26 -p GetProcessMem.new.mb 26 +# p GetProcessMem.new.mb
27 27
28 time = 28 time =
29 Benchmark.realtime do 29 Benchmark.realtime do
@@ -33,14 +33,16 @@ time = @@ -33,14 +33,16 @@ time =
33 # end 33 # end
34 end 34 end
35 35
36 -p GetProcessMem.new.mb 36 +# p GetProcessMem.new.mb
37 37
38 puts time.round(1) 38 puts time.round(1)
39 puts Product.searchkick_index.total_docs 39 puts Product.searchkick_index.total_docs
40 40
41 # puts result.allocations(alias_paths: true).group_by(:sourcefile, :class).to_text 41 # puts result.allocations(alias_paths: true).group_by(:sourcefile, :class).to_text
42 42
43 -# printer = RubyProf::GraphPrinter.new(result)  
44 -# printer.print(STDOUT, min_percent: 2) 43 +if result
  44 + printer = RubyProf::GraphPrinter.new(result)
  45 + printer.print(STDOUT, min_percent: 2)
  46 +end
45 47
46 # puts Product.count 48 # puts Product.count