mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
driver.rb: name width
* benchmark/driver.rb (BenchmarkDriver#adjusted_results): calculate max width of names at last. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
744a858bd2
commit
71a352f0a7
1 changed files with 1 additions and 3 deletions
|
@ -81,7 +81,6 @@ class BenchmarkDriver
|
|||
@loop_wl1 = @loop_wl2 = nil
|
||||
@ruby_arg = opt[:ruby_arg] || nil
|
||||
@opt = opt
|
||||
@name_width = 4 # "name".size
|
||||
|
||||
# [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
|
||||
@results = []
|
||||
|
@ -134,7 +133,7 @@ class BenchmarkDriver
|
|||
numformat = " %1$*2$.3f"
|
||||
end
|
||||
|
||||
name_width ||= @name_width
|
||||
name_width ||= @results.map {|v,*| v.size}.max
|
||||
minwidth ||= 7
|
||||
width = @execs.map{|(_, v)| [v.size, minwidth].max}
|
||||
|
||||
|
@ -258,7 +257,6 @@ class BenchmarkDriver
|
|||
output
|
||||
end
|
||||
|
||||
@name_width = name.size if name.size > @name_width
|
||||
result = [name]
|
||||
result << @execs.map{|(e, v)|
|
||||
(0...@repeat).map{
|
||||
|
|
Loading…
Reference in a new issue