[Groonga-commit] droonga/fluent-plugin-droonga at 03dcda2 [master] Benchmark: make it more stable

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Nov 1 18:06:14 JST 2013


YUKI Hiroshi	2013-11-01 18:06:14 +0900 (Fri, 01 Nov 2013)

  New Revision: 03dcda2991605f462173e31e81441586b565f70a
  https://github.com/droonga/fluent-plugin-droonga/commit/03dcda2991605f462173e31e81441586b565f70a

  Message:
    Benchmark: make it more stable

  Modified files:
    benchmark/watch/benchmark-scan.rb

  Modified: benchmark/watch/benchmark-scan.rb (+11 -4)
===================================================================
--- benchmark/watch/benchmark-scan.rb    2013-11-01 17:50:18 +0900 (e3f99d1)
+++ benchmark/watch/benchmark-scan.rb    2013-11-01 18:06:14 +0900 (18f97a2)
@@ -113,27 +113,34 @@ results_for_specific_condition = {}
 scan_benchmark = ScanBenchmark.new(options[:n_watching_keywords])
 options[:n_steps].times do |try_count|
   scan_benchmark.add_keywords(scan_benchmark.n_keywords) if try_count > 0
+  GC.start
+  sleep 1
   puts "\n=============== #{scan_benchmark.n_keywords} keywords ===============\n"
   options[:incidences].split(/[,\s]+/).each do |incidence|
     incidence = incidence.to_f
     options[:matched_keywords].split(/[,\s]+/).each do |matched_keywords|
       matched_keywords = matched_keywords.to_i
+
+      GC.disable
+
       condition = "#{incidence * 100}%/#{matched_keywords}match"
       results_for_specific_condition[condition] ||= []
       label = "#{incidence * 100} %/#{matched_keywords} match/#{scan_benchmark.n_keywords} keywords"
-      GC.disable
-      result = Benchmark.bm do |benchmark|
+
+      result = Benchmark.bmbm do |benchmark|
         scan_benchmark.prepare_targets(:incidence => incidence,
                                        :matched_keywords => matched_keywords)
         benchmark.report(label) do
           scan_benchmark.run
         end
       end
-      GC.enable
-      GC.start
 
       result = result.join("").strip.gsub(/[()]/, "").split(/\s+/)
       results_for_specific_condition[condition] << [label] + result
+
+      GC.enable
+      GC.start
+      sleep 1
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index