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

ruby-changes:33770

From: ko1 <ko1@a...>
Date: Wed, 7 May 2014 11:57:20 +0900 (JST)
Subject: [ruby-changes:33770] ko1:r45851 (trunk): * benchmark/driver.rb: add '--rawdata-output=[FILE] option to output

ko1	2014-05-07 11:57:11 +0900 (Wed, 07 May 2014)

  New Revision: 45851

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

  Log:
    * benchmark/driver.rb: add '--rawdata-output=[FILE] option to output
      raw results into FILE.

  Modified files:
    trunk/ChangeLog
    trunk/benchmark/driver.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45850)
+++ ChangeLog	(revision 45851)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May  7 11:55:40 2014  Koichi Sasada  <ko1@a...>
+
+	* benchmark/driver.rb: add '--rawdata-output=[FILE] option to output
+	  raw results into FILE.
+
 Wed May  7 11:25:41 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* vm_eval.c (rb_f_local_variables): exclude variables hidden by
Index: benchmark/driver.rb
===================================================================
--- benchmark/driver.rb	(revision 45850)
+++ benchmark/driver.rb	(revision 45851)
@@ -77,6 +77,7 @@ class BenchmarkDriver https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L77
     @exclude = opt[:exclude] || nil
     @verbose = opt[:quiet] ? false : (opt[:verbose] || false)
     @output = opt[:output] ? open(opt[:output], 'w') : nil
+    @rawdata_output = opt[:rawdata_output] ? open(opt[:rawdata_output], 'w') : nil
     @loop_wl1 = @loop_wl2 = nil
     @ruby_arg = opt[:ruby_arg] || nil
     @opt = opt
@@ -128,6 +129,15 @@ class BenchmarkDriver https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L129
       message "Elapsed time: #{Time.now - @start_time} (sec)"
     end
 
+    if @rawdata_output
+      h = {}
+      h[:cpuinfo] = File.read('/proc/cpuinfo') if File.exist?('/proc/cpuinfo')
+      h[:executables] = @execs
+      h[:results] = @results
+      pp h
+      # @rawdata_output.puts h.inspect
+    end
+
     output '-----------------------------------------------------------'
     output 'benchmark results:'
 
@@ -266,6 +276,7 @@ if __FILE__ == $0 https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L276
     :dir => File.dirname(__FILE__),
     :repeat => 1,
     :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
+    :raw_output => nil
   }
 
   parser = OptionParser.new{|o|
@@ -293,12 +304,16 @@ if __FILE__ == $0 https://github.com/ruby/ruby/blob/trunk/benchmark/driver.rb#L304
     o.on('--ruby-arg [ARG]', "Optional argument for ruby"){|a|
       opt[:ruby_arg] = a
     }
-    o.on('-q', '--quiet', "Run without notify information except result table."){|q|
-      opt[:quiet] = q
+    o.on('--rawdata-output [FILE]', 'output rawdata'){|r|
+      opt[:rawdata_output] = r
     }
     o.on('-v', '--verbose'){|v|
       opt[:verbose] = v
     }
+    o.on('-q', '--quiet', "Run without notify information except result table."){|q|
+      opt[:quiet] = q
+      opt[:verbose] = false
+    }
   }
 
   parser.parse!(ARGV)

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

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