Title: [200914] trunk/Tools
Revision
200914
Author
[email protected]
Date
2016-05-13 21:58:41 -0700 (Fri, 13 May 2016)

Log Message

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:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (200913 => 200914)


--- trunk/Tools/ChangeLog	2016-05-14 04:45:42 UTC (rev 200913)
+++ trunk/Tools/ChangeLog	2016-05-14 04:58:41 UTC (rev 200914)
@@ -1,3 +1,18 @@
+2016-05-13  Dewei Zhu  <[email protected]>
+
+        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  <[email protected]>
 
         Extend protector naming code style guideline to cover operator= assignment.

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py (200913 => 200914)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py	2016-05-14 04:45:42 UTC (rev 200913)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py	2016-05-14 04:58:41 UTC (rev 200914)
@@ -89,7 +89,8 @@
         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)
 

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/data/patches/JSBench.patch (200913 => 200914)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/data/patches/JSBench.patch	2016-05-14 04:45:42 UTC (rev 200913)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/data/patches/JSBench.patch	2016-05-14 04:58:41 UTC (rev 200914)
@@ -24,7 +24,7 @@
                  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 + ": [";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to