Skip to content

Commit

Permalink
* benchmark/driver.rb: some refactoring.
Browse files Browse the repository at this point in the history
  (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
  • Loading branch information
ko1 committed Oct 16, 2012
1 parent 9af8102 commit 64b1751
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Tue Oct 16 21:59:01 2012 Koichi Sasada <[email protected]>

* 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 <[email protected]>

* file.c (rb_file_join): need to check again after any conversion run.
Expand Down
19 changes: 5 additions & 14 deletions benchmark/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ def show_results
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
Expand All @@ -137,18 +134,12 @@ def show_results
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

Expand Down Expand Up @@ -234,7 +225,7 @@ def measure executable, file
if __FILE__ == $0
opt = {
:execs => ['ruby'],
:dir => './',
:dir => File.dirname(__FILE__),
:repeat => 1,
:output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
}
Expand Down

0 comments on commit 64b1751

Please sign in to comment.