[前][次][番号順一覧][スレッド一覧]

ruby-changes:29405

From: ko1 <ko1@a...>
Date: Thu, 20 Jun 2013 06:26:42 +0900 (JST)
Subject: [ruby-changes:29405] ko1:r41457 (trunk): * tool/rdocbench.rb: add summary.

ko1	2013-06-20 06:26:13 +0900 (Thu, 20 Jun 2013)

  New Revision: 41457

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41457

  Log:
    * tool/rdocbench.rb: add summary.

  Modified files:
    trunk/ChangeLog
    trunk/tool/rdocbench.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41456)
+++ ChangeLog	(revision 41457)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jun 20 06:25:39 2013  Koichi Sasada  <ko1@a...>
+
+	* tool/rdocbench.rb: add summary.
+
 Thu Jun 20 06:18:01 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (gc_profile_total_time): check objspace->profile.next_index > 0.
Index: tool/rdocbench.rb
===================================================================
--- tool/rdocbench.rb	(revision 41456)
+++ tool/rdocbench.rb	(revision 41457)
@@ -10,13 +10,19 @@ Dir.mktmpdir('rdocbench-'){|d| https://github.com/ruby/ruby/blob/trunk/tool/rdocbench.rb#L10
   args << '--op' << dir
 
   GC::Profiler.enable
-  Benchmark.bm{|x|
-    x.report('rdoc'){
-      r = RDoc::RDoc.new
-      r.document args
-      GC::Profiler.report
-      pp GC.stat
-      puts "GC Total Time:#{GC::Profiler.total_time}"
-    }
+  tms = Benchmark.measure{|x|
+    r = RDoc::RDoc.new
+    r.document args
   }
+  GC::Profiler.report
+  pp GC.stat
+  puts
+  puts Benchmark::CAPTION
+  puts tms
+  puts "GC total time (sec): #{GC::Profiler.total_time}"
+  puts
+  puts "Summary (ruby): #{RUBY_DESCRIPTION})"
+  puts "Summary (real): #{tms.real} sec"
+  puts "Summary (gctm): #{GC::Profiler.total_time} sec"
+  puts "Summary (gc#) : #{GC.count}"
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]