Make compare-results understand MotionMark
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Apr 2019 02:05:11 +0000 (02:05 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Apr 2019 02:05:11 +0000 (02:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196666

Reviewed by Yusuke Suzuki.

* Scripts/compare-results:
(PLT5Results):
(detectMotionMark):
(detectMotionMark1_1):
(motionMarkResults):
(motionMark1_1Results):
(detectBenchmark):
(biggerIsBetter):
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243960 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/compare-results

index d9fd453..02cf621 100644 (file)
@@ -1,3 +1,20 @@
+2019-04-05  Saam Barati  <sbarati@apple.com>
+
+        Make compare-results understand MotionMark
+        https://bugs.webkit.org/show_bug.cgi?id=196666
+
+        Reviewed by Yusuke Suzuki.
+
+        * Scripts/compare-results:
+        (PLT5Results):
+        (detectMotionMark):
+        (detectMotionMark1_1):
+        (motionMarkResults):
+        (motionMark1_1Results):
+        (detectBenchmark):
+        (biggerIsBetter):
+        (main):
+
 2019-04-05  Alex Christensen  <achristensen@webkit.org>
 
         Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
index 1ddbddb..15b5017 100644 (file)
@@ -49,6 +49,8 @@ def readJSONFile(path):
 Speedometer2 = "Speedometer2"
 JetStream2 = "JetStream2"
 PLT5 = "PLT5"
+MotionMark = "MotionMark"
+MotionMark1_1 = "MotionMark-1.1"
 
 def detectJetStream2(payload):
     return "JetStream2.0" in payload
@@ -102,6 +104,32 @@ def PLT5Results(payload):
         results.append(obj["Geometric"])
     return results
 
+def detectMotionMark(payload):
+    return "MotionMark" in payload
+
+def detectMotionMark1_1(payload):
+    return "MotionMark-1.1" in payload
+
+def motionMarkResults(payload):
+    assert detectMotionMark(payload) or detectMotionMark1_1(payload)
+    if detectMotionMark(payload):
+        payload = payload["MotionMark"]
+    else:
+        payload = payload["MotionMark-1.1"]
+    testNames = payload["tests"].keys()
+    numTests = len(payload["tests"][testNames[0]]["metrics"]["Score"]["current"])
+    results = []
+    for i in range(numTests):
+        scores = []
+        for test in testNames:
+            scores.append(payload["tests"][test]["metrics"]["Score"]["current"][i])
+        results.append(stats.gmean(scores))
+
+    return results
+
+def motionMark1_1Results(payload):
+    return motionMarkResults(payload)
+
 def detectBenchmark(payload):
     if detectJetStream2(payload):
         return JetStream2
@@ -109,6 +137,10 @@ def detectBenchmark(payload):
         return Speedometer2
     if detectPLT5(payload):
         return PLT5
+    if detectMotionMark(payload):
+        return MotionMark
+    if detectMotionMark1_1(payload):
+        return MotionMark1_1
     return None
 
 def biggerIsBetter(benchmarkType):
@@ -116,6 +148,10 @@ def biggerIsBetter(benchmarkType):
         return True
     if benchmarkType == Speedometer2:
         return True
+    if benchmarkType == MotionMark:
+        return True
+    if benchmarkType == MotionMark1_1:
+        return True
     if benchmarkType == PLT5:
         return False
 
@@ -187,6 +223,10 @@ def main():
         ttest(typeA, JetStream2Results(a), JetStream2Results(b))
     elif typeA == Speedometer2:
         ttest(typeA, Speedometer2Results(a), Speedometer2Results(b))
+    elif typeA == MotionMark:
+        ttest(typeA, motionMarkResults(a), motionMarkResults(b))
+    elif typeA == MotionMark1_1:
+        ttest(typeA, motionMark1_1Results(a), motionMark1_1Results(b))
     elif typeA == PLT5:
         ttest(typeA, PLT5Results(a), PLT5Results(b))
     else: