Title: [130341] trunk/PerformanceTests
Revision
130341
Author
jchaffr...@webkit.org
Date
2012-10-03 16:28:46 -0700 (Wed, 03 Oct 2012)

Log Message

Add a performance test for subtree detaching
https://bugs.webkit.org/show_bug.cgi?id=98281

Reviewed by Eric Seidel.

The new test tries to stress detaching on a heavy subtree (2 levels deep but with 1,000 nodes per level).
We set display: none on the root and measure the time it takes to update the tree. Note that we will also
measure the time taken by recalcStyle and relayout but I don't think we can avoid that.

* Layout/subtree-detaching.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/PerformanceTests/ChangeLog (130340 => 130341)


--- trunk/PerformanceTests/ChangeLog	2012-10-03 23:27:53 UTC (rev 130340)
+++ trunk/PerformanceTests/ChangeLog	2012-10-03 23:28:46 UTC (rev 130341)
@@ -1,3 +1,16 @@
+2012-10-03  Julien Chaffraix  <jchaffr...@webkit.org>
+
+        Add a performance test for subtree detaching
+        https://bugs.webkit.org/show_bug.cgi?id=98281
+
+        Reviewed by Eric Seidel.
+
+        The new test tries to stress detaching on a heavy subtree (2 levels deep but with 1,000 nodes per level).
+        We set display: none on the root and measure the time it takes to update the tree. Note that we will also
+        measure the time taken by recalcStyle and relayout but I don't think we can avoid that.
+
+        * Layout/subtree-detaching.html: Added.
+
 2012-10-02  Ryosuke Niwa  <rn...@webkit.org>
 
         Build fix after r130135. Dromaeo tests only report single memory value,

Added: trunk/PerformanceTests/Layout/subtree-detaching.html (0 => 130341)


--- trunk/PerformanceTests/Layout/subtree-detaching.html	                        (rev 0)
+++ trunk/PerformanceTests/Layout/subtree-detaching.html	2012-10-03 23:28:46 UTC (rev 130341)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+function buildTree()
+{
+    wrapper = document.createElement("div");
+    for (i = 0; i < 1000; ++i) {
+        var child = document.createElement("div");
+        for (j = 0; j < 1000; ++j) {
+            var grandChild = document.createElement("div");
+            child.appendChild(grandChild);
+        }
+        wrapper.appendChild(child);
+    }
+    document.body.appendChild(wrapper);
+}
+
+function setup() {
+    wrapper.style.display = "block";
+    // Force a layout so that everything is up-to-date.
+    wrapper.offsetTop;
+}
+
+function runTest() {
+    setup();
+
+    var now = PerfTestRunner.now();
+
+    wrapper.style.display = "none";
+    wrapper.offsetTop;
+
+    return PerfTestRunner.now() - now;
+}
+
+buildTree();
+
+PerfTestRunner.measureTime({run: runTest, runCount: 20, description: "This benchmark checks the time spend in detaching an tree." });
+</script>
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to