mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
9af8102225
commit
64b1751194
2 changed files with 18 additions and 14 deletions
13
ChangeLog
13
ChangeLog
|
@ -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>
|
||||
|
||||
* file.c (rb_file_join): need to check again after any conversion run.
|
||||
|
|
|
@ -113,10 +113,7 @@ class BenchmarkDriver
|
|||
output "minimum results in each #{@repeat} measurements."
|
||||
end
|
||||
|
||||
difference = "\taverage difference" if @execs.length == 2
|
||||
total_difference = 0
|
||||
|
||||
output "name\t#{@execs.map{|(_, v)| v}.join("\t")}#{difference}"
|
||||
output "name\t#{@execs.map{|(_, v)| v}.join("\t")}"
|
||||
@results.each{|v, result|
|
||||
rets = []
|
||||
s = nil
|
||||
|
@ -137,18 +134,12 @@ class BenchmarkDriver
|
|||
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")}"
|
||||
}
|
||||
|
||||
if difference and @verbose
|
||||
output '-----------------------------------------------------------'
|
||||
output "average total difference is #{total_difference}"
|
||||
if @opt[:output]
|
||||
output
|
||||
output "Log file: #{@opt[:output]}"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -234,7 +225,7 @@ end
|
|||
if __FILE__ == $0
|
||||
opt = {
|
||||
:execs => ['ruby'],
|
||||
:dir => './',
|
||||
:dir => File.dirname(__FILE__),
|
||||
:repeat => 1,
|
||||
:output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue