summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-05 08:17:26 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-05 08:17:26 (GMT)
commit71a352f0a729fa2116f8227f26d47295f71269c1 (patch)
treecd8a1af1d2e45204a85ae8646002f0c33c59a238 /benchmark
parent744a858bd2adb01cb2aca143a1063ff3bdadfaed (diff)
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
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/driver.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index 58d4c5b..07c5ad4 100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -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{