Add a microbenchmark for a full-page render of the HTML5 spec
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 00:13:01 +0000 (00:13 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 00:13:01 +0000 (00:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69285

Reviewed by Adam Barth.

This was designed to be a test for https://bugs.webkit.org/show_bug.cgi?id=68944
But it seems that by far our dominating cost for the HTML5 benchmark is
time spent laying out lines (which isn't actually that surprising).

I'm adding the performance test for posterity.

* Parser/html-parser.html:
 - Removed use of "about:blank" which abarth says is a no-op.  Made comment more accurate.
* Parser/html5-full-render.html: Copied from PerformanceTests/Parser/html-parser.html.

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

PerformanceTests/ChangeLog
PerformanceTests/Parser/html-parser.html
PerformanceTests/Parser/html5-full-render.html [new file with mode: 0644]

index 3eec52e..9e8fbe6 100644 (file)
@@ -1,5 +1,22 @@
 2011-10-03  Eric Seidel  <eric@webkit.org>
 
+        Add a microbenchmark for a full-page render of the HTML5 spec
+        https://bugs.webkit.org/show_bug.cgi?id=69285
+
+        Reviewed by Adam Barth.
+
+        This was designed to be a test for https://bugs.webkit.org/show_bug.cgi?id=68944
+        But it seems that by far our dominating cost for the HTML5 benchmark is
+        time spent laying out lines (which isn't actually that surprising).
+
+        I'm adding the performance test for posterity.
+
+        * Parser/html-parser.html:
+         - Removed use of "about:blank" which abarth says is a no-op.  Made comment more accurate.
+        * Parser/html5-full-render.html: Copied from PerformanceTests/Parser/html-parser.html.
+
+2011-10-03  Eric Seidel  <eric@webkit.org>
+
         PerformanceTests/Parser/html-parser is only testing parsing of the head element
         https://bugs.webkit.org/show_bug.cgi?id=69283
 
index bf71302..a9bcd68 100644 (file)
@@ -7,9 +7,8 @@ var spec = loadFile("resources/html5.html");
 
 start(20, function() {
     var iframe = document.createElement("iframe");
-    iframe.src = "about:blank";
     iframe.style.display = "none";  // Prevent creation of the rendering tree, so we only test HTML parsing.
-    iframe.sandbox = '';  // Prevents loading of external scripts which would otherwise pause the parser.
+    iframe.sandbox = '';  // Prevent external script loads which could cause write() to return before completing the parse.
     document.body.appendChild(iframe);
     iframe.contentDocument.open();
     iframe.contentDocument.write(spec);
diff --git a/PerformanceTests/Parser/html5-full-render.html b/PerformanceTests/Parser/html5-full-render.html
new file mode 100644 (file)
index 0000000..f44d753
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<body>
+<pre id="log"></pre>
+<script src="resources/runner.js"></script>
+<script>
+var spec = loadFile("resources/html5.html");
+
+// Each iteration currently takes 30s to run on a fast machine, so we only run 2.
+start(2, function() {
+    var iframe = document.createElement("iframe");
+    iframe.sandbox = '';  // Prevent external script loads which could cause write() to return before completing the parse.
+    document.body.appendChild(iframe);
+    iframe.contentDocument.open();
+    iframe.contentDocument.write(spec);
+    iframe.contentDocument.close();
+    iframe.contentDocument.body.clientHeight; // Force a full style-resolve.
+    document.body.removeChild(iframe);
+});
+</script>
+</body>