Project

General

Profile

Feature #4982 ยป benchmark-driver.rb.difference.patch

drbrain (Eric Hodel), 07/06/2011 01:19 PM

View differences:

benchmark/driver.rb (working copy)
109 109
      output "minimum results in each #{@repeat} measurements."
110 110
    end
111 111

  
112
    output "name\t#{@execs.map{|(e, v)| v}.join("\t")}"
112
    difference = "\tdifference" if @execs.length == 2 and @repeat == 1
113
    total_difference = 0
114

  
115
    output "name\t#{@execs.map{|(e, v)| v}.join("\t")}#{difference}"
113 116
    @results.each{|v, result|
114 117
      rets = []
115 118
      s = nil
......
129 132
        end
130 133
        rets << sprintf("%.3f", r)
131 134
      }
135

  
136
      if difference
137
        diff = result.flatten.last - result.flatten.first
138
        total_difference += diff
139
        rets << sprintf("%.3f", diff)
140
      end
141

  
132 142
      output "#{v}#{s}\t#{rets.join("\t")}"
133 143
    }
144

  
145
    if difference and @verbose
146
      output '-----------------------------------------------------------'
147
      output "total difference is #{total_difference}"
148
    end
134 149
  end
135 150

  
136 151
  def files