Title: [282111] trunk/PerformanceTests
Revision
282111
Author
mmaxfi...@apple.com
Date
2021-09-07 15:15:14 -0700 (Tue, 07 Sep 2021)

Log Message

Add a PerformanceTest for some common FontFaceSet style update operations
https://bugs.webkit.org/show_bug.cgi?id=229913

Reviewed by Stephanie Lewis.

This is similar to some of the operations we've seen in the wild.
We want to make sure we can do these fast.

* CSS/FontFaceSetUpdateStyle.html: Added.

Modified Paths

Added Paths

Diff

Added: trunk/PerformanceTests/CSS/FontFaceSetUpdateStyle.html (0 => 282111)


--- trunk/PerformanceTests/CSS/FontFaceSetUpdateStyle.html	                        (rev 0)
+++ trunk/PerformanceTests/CSS/FontFaceSetUpdateStyle.html	2021-09-07 22:15:14 UTC (rev 282111)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head id="head">
+<script src=""
+<style id="style">
+</style>
+</head>
+<body id="body">
+<div id="test"></div>
+</body>
+<script>
+let head = document.getElementById("head");
+let style = document.getElementById("style");
+let body = document.getElementById("body");
+let styleString = "";
+let elementCount = 1000;
+for (let i = 0; i < elementCount; ++i) {
+    let div = document.createElement("div");
+    let id = `div${i}`;
+    div.id = id;
+    body.appendChild(div);
+    styleString = styleString + `#${id} { font-weight: ${i}; }`;
+}
+style.innerText = styleString;
+PerfTestRunner.measureRunsPerSecond({run:function() {
+    style.innerText = `${styleString}`;
+    let fontFace = new FontFace("WebFont", "url('MyCoolWebFont.ttf') format('truetype')");
+    if (!document.fonts.has(fontFace))
+        document.fonts.add(fontFace)
+    document.fonts.clear();
+}});
+</script>
+</html>

Modified: trunk/PerformanceTests/ChangeLog (282110 => 282111)


--- trunk/PerformanceTests/ChangeLog	2021-09-07 22:14:26 UTC (rev 282110)
+++ trunk/PerformanceTests/ChangeLog	2021-09-07 22:15:14 UTC (rev 282111)
@@ -1,3 +1,15 @@
+2021-09-07  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Add a PerformanceTest for some common FontFaceSet style update operations
+        https://bugs.webkit.org/show_bug.cgi?id=229913
+
+        Reviewed by Stephanie Lewis.
+
+        This is similar to some of the operations we've seen in the wild.
+        We want to make sure we can do these fast.
+
+        * CSS/FontFaceSetUpdateStyle.html: Added.
+
 2021-08-06  Michael Catanzaro  <mcatanz...@gnome.org>
 
         MallocBench: fix ODR violation
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to