Title: [291436] trunk/Tools
Revision
291436
Author
sbar...@apple.com
Date
2022-03-17 13:22:19 -0700 (Thu, 17 Mar 2022)

Log Message

compare-results should break down sync vs async time in Speedometer2
https://bugs.webkit.org/show_bug.cgi?id=237993

Reviewed by Alexey Shvayka.

* Scripts/compare-results:
(speedometer2Breakdown):
(speedometer2BreakdownSyncAsync):
(dumpBreakdowns):
(getOptions):
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (291435 => 291436)


--- trunk/Tools/ChangeLog	2022-03-17 20:19:28 UTC (rev 291435)
+++ trunk/Tools/ChangeLog	2022-03-17 20:22:19 UTC (rev 291436)
@@ -1,3 +1,17 @@
+2022-03-17  Saam Barati  <sbar...@apple.com>
+
+        compare-results should break down sync vs async time in Speedometer2
+        https://bugs.webkit.org/show_bug.cgi?id=237993
+
+        Reviewed by Alexey Shvayka.
+
+        * Scripts/compare-results:
+        (speedometer2Breakdown):
+        (speedometer2BreakdownSyncAsync):
+        (dumpBreakdowns):
+        (getOptions):
+        (main):
+
 2022-03-17  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Delete Tools/jsc-cli in favor of the jsc target in _javascript_Core itself

Modified: trunk/Tools/Scripts/compare-results (291435 => 291436)


--- trunk/Tools/Scripts/compare-results	2022-03-17 20:19:28 UTC (rev 291435)
+++ trunk/Tools/Scripts/compare-results	2022-03-17 20:22:19 UTC (rev 291436)
@@ -72,6 +72,26 @@
         result[test] = breakdown._results["Speedometer-2"]["tests"][test]["metrics"]["Time"]["Total"]["current"]
     return result
 
+def speedometer2BreakdownSyncAsync(jsonObject):
+    breakdown = BenchmarkResults(jsonObject)
+    result = {}
+    result[unitMarker] = "ms"
+    for test in breakdown._results["Speedometer-2"]["tests"].keys():
+        syncTime = None
+        asyncTime = None
+        for value in breakdown._results["Speedometer-2"]["tests"][test]["tests"].values():
+            syncArray = value["tests"]["Sync"]["metrics"]["Time"][None]["current"]
+            asyncArray = value["tests"]["Async"]["metrics"]["Time"][None]["current"]
+            if not syncTime:
+                syncTime = syncArray
+                asyncTime = asyncArray
+            else:
+                syncTime = [x + y for x, y in zip(syncTime, syncArray)]
+                asyncTime = [x + y for x, y in zip(asyncTime, asyncArray)]
+        result[test + "-sync"] = syncTime
+        result[test + "-async"] = asyncTime
+    return result
+
 def jetStream2Breakdown(jsonObject):
     breakdown = BenchmarkResults(jsonObject)
     result = {}
@@ -239,7 +259,7 @@
 
     strings = []
     strings.append("|{key:^{nameLength}}|{aScore:^{aLength}} |{bScore:^{bLength}} |{compare:^{ratioLength}}|{pMarker:^{pLength}}|".format(key="subtest", aScore=a[unitMarker], bScore=b[unitMarker], nameLength=nameLength, aLength=aLength, bLength=bLength , compare="b / a", ratioLength=ratioLength, pMarker=pValueHeader, pLength=pLength))
-    for key in a.keys():
+    for key in sorted(a.keys()):
         if key == unitMarker:
             continue
 
@@ -495,6 +515,9 @@
     parser.add_argument("--breakdown", action=""
         default=False, help="Print a per subtest breakdown.")
 
+    parser.add_argument("--sync-vs-async", action=""
+        default=False, help="Print a per subtest breakdown in Speedometer2 by sync and async time.")
+
     return parser.parse_known_args()[0]
 
 
@@ -529,7 +552,10 @@
             writeCSV(jetStream2Breakdown(a), jetStream2Breakdown(b), args.csv)
     elif typeA == Speedometer2:
         if args.breakdown:
-            dumpBreakdowns(speedometer2Breakdown(a), speedometer2Breakdown(b))
+            if args.sync_vs_async:
+                dumpBreakdowns(speedometer2BreakdownSyncAsync(a), speedometer2BreakdownSyncAsync(b))
+            else:
+                dumpBreakdowns(speedometer2Breakdown(a), speedometer2Breakdown(b))
 
         ttest(typeA, Speedometer2Results(a), Speedometer2Results(b))
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to