* benchmark/driver.rb: some refactoring.

(1) Remove `average differential'.
  In this benchmark driver, We should not care about `average'.
  We use fastest score because this score should not include
  any disturbances (affections of background process, etc).
  If you care about timing affect, I recommend `median'
  score with more than 5 examinations rather than simple
  `average' score (`average' score was affected by error scores).
  (2) Show log file name.
  (3) Change default directory from './' to driver's directory.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2012-10-16 13:07:44 +00:00
parent 9af8102225
commit 64b1751194
2 changed files with 18 additions and 14 deletions

View File

@ -1,3 +1,16 @@
Tue Oct 16 21:59:01 2012 Koichi Sasada <ko1@atdot.net>
* benchmark/driver.rb: some refactoring.
(1) Remove `average differential'.
In this benchmark driver, We should not care about `average'.
We use fastest score because this score should not include
any disturbances (affections of background process, etc).
If you care about timing affect, I recommend `median'
score with more than 5 examinations rather than simple
`average' score (`average' score was affected by error scores).
(2) Show log file name.
(3) Change default directory from './' to driver's directory.
Tue Oct 16 14:56:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Oct 16 14:56:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_join): need to check again after any conversion run. * file.c (rb_file_join): need to check again after any conversion run.

View File

@ -113,10 +113,7 @@ class BenchmarkDriver
output "minimum results in each #{@repeat} measurements." output "minimum results in each #{@repeat} measurements."
end end
difference = "\taverage difference" if @execs.length == 2 output "name\t#{@execs.map{|(_, v)| v}.join("\t")}"
total_difference = 0
output "name\t#{@execs.map{|(_, v)| v}.join("\t")}#{difference}"
@results.each{|v, result| @results.each{|v, result|
rets = [] rets = []
s = nil s = nil
@ -137,18 +134,12 @@ class BenchmarkDriver
rets << sprintf("%.3f", r) rets << sprintf("%.3f", r)
} }
if difference
diff = average(result.last) - average(result.first)
total_difference += diff
rets << sprintf("%.3f", diff)
end
output "#{v}#{s}\t#{rets.join("\t")}" output "#{v}#{s}\t#{rets.join("\t")}"
} }
if difference and @verbose if @opt[:output]
output '-----------------------------------------------------------' output
output "average total difference is #{total_difference}" output "Log file: #{@opt[:output]}"
end end
end end
@ -234,7 +225,7 @@ end
if __FILE__ == $0 if __FILE__ == $0
opt = { opt = {
:execs => ['ruby'], :execs => ['ruby'],
:dir => './', :dir => File.dirname(__FILE__),
:repeat => 1, :repeat => 1,
:output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}", :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
} }