+2016-05-13 Dewei Zhu <dewei_zhu@apple.com>
+
+ Fix JSBench which causes math domain error in run-benchmark script.
+ https://bugs.webkit.org/show_bug.cgi?id=157697
+ <rdar://problem/26279292>
+
+ Reviewed by Ryosuke Niwa.
+
+ Some tests of JSBench give time usage to be 0 ms which will causes error while calculating geometric mean.
+ Also fix a round-off error while calculating stdev.
+
+ * Scripts/webkitpy/benchmark_runner/benchmark_results.py:
+ (BenchmarkResults._format_values):
+ * Scripts/webkitpy/benchmark_runner/data/patches/JSBench.patch:
+
2016-05-13 Brady Eidson <beidson@apple.com>
Extend protector naming code style guideline to cover operator= assignment.
if sample_count <= 1:
sample_stdev = 0
else:
- sample_stdev = math.sqrt(square_sum / (sample_count - 1) - total * total / (sample_count - 1) / sample_count)
+ # Be careful about round-off error when sample_stdev is 0.
+ sample_stdev = math.sqrt(max(0, square_sum / (sample_count - 1) - total * total / (sample_count - 1) / sample_count))
unit = cls._unit_from_metric(metric_name)
if (bmresults.length == 0) continue;
+ if (pr)
-+ tests[benchmark] = {'metrics': {'Time': {'current': bmresults}}};
++ tests[benchmark] = {'metrics': {'Time': {'current': bmresults.map(function (value) { return value || 1; })}}};
+
// get the raw results
var rr = spc2 + mode + ": [";