Web Inspector: chromium: increase heap snapshot performance coverage.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2012 12:31:41 +0000 (12:31 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2012 12:31:41 +0000 (12:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80829

Reviewed by Yury Semikhatsky.

* inspector/detailed-heapshots-smoke-test.html:
* inspector/performance-test.js:
(initialize_TimeTracker.InspectorTest.measureFunction):

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

PerformanceTests/ChangeLog
PerformanceTests/inspector/detailed-heapshots-smoke-test.html
PerformanceTests/inspector/performance-test.js

index 1bc8812..e1b6993 100644 (file)
@@ -1,3 +1,14 @@
+2012-03-12  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: chromium: increase heap snapshot performance coverage.
+        https://bugs.webkit.org/show_bug.cgi?id=80829
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/detailed-heapshots-smoke-test.html:
+        * inspector/performance-test.js:
+        (initialize_TimeTracker.InspectorTest.measureFunction):
+
 2012-03-06  Kentaro Hara  <haraken@chromium.org>
 
         [Perf tests] Reduce the number of loops in dom-attributes.html
index 1313742..8daaa7a 100644 (file)
@@ -9,18 +9,26 @@ function test()
 {
     function performanceTest(timer)
     {
-
         var transferTimerCookie;
         var showTimerCookie;
         var changeViewTimerCookie;
         var clearTimerCookie;
 
-        var allTimerCookie = timer.start("summary-snapshot-time");
+        var fullTimerCookie = timer.start("full-summary-snapshot-time");
         var backendTimerCookie = timer.start("take-snapshot");
         ProfilerAgent.takeHeapSnapshot(step0);
 
         function step0()
         {
+            InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_buildRetainers");
+            InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_buildDominatedNodes");
+            InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateFlags");
+            InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_buildAggregates");
+            InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateObjectToWindowDistance");
+            InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_buildNodeIndex");
+            InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_markDetachedDOMTreeNodes");
+            InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_markQueriableHeapObjects");
+
             timer.finish(backendTimerCookie);
             transferTimerCookie = timer.start("transfer-snapshot");
             var profiles = WebInspector.panels.profiles.getProfiles("HEAP");
@@ -40,7 +48,6 @@ function test()
         function step2()
         {
             timer.finish(showTimerCookie);
-            timer.finish(allTimerCookie);
             changeViewTimerCookie = timer.start("switch-to-containment-view");
             InspectorTest.switchToView("Containment", cleanup);
         }
@@ -48,6 +55,7 @@ function test()
         function cleanup()
         {
             timer.finish(changeViewTimerCookie);
+            timer.finish(fullTimerCookie);
             clearTimerCookie = timer.start("clear-snapshot");
             ProfilerAgent.clearProfiles(done);
             WebInspector.panels.profiles._reset();
@@ -56,13 +64,33 @@ function test()
         function done()
         {
             timer.finish(clearTimerCookie);
-            timer.done("panel-update");
+            timer.done("heap-snapshot");
         }
     }
 
-    InspectorTest.runPerformanceTest(performanceTest, 25000);
+    InspectorTest.runPerformanceTest(performanceTest, 60000);
+}
+
+var counter = 0;
+
+function makeObjectsTree(deep)
+{
+    var node = {};
+    node.text = "some text " + counter;
+    if (deep === 0)
+        return node;
+    for (var i = 0; i < 2; ++i)
+        node[counter++] = makeObjectsTree(deep - 1);
+    return node;
 }
 
+function makeObjectsTree2(name, deep)
+{
+    window[name] = makeObjectsTree(deep);
+}
+
+makeObjectsTree2("t", 14);
+
 </script>
 </head>
 <body onload="runTest()">
index b0cf495..fbb5ec2 100644 (file)
@@ -86,6 +86,23 @@ InspectorTest.runPerformanceTest = function(perfTest, executeTime, callback)
     InspectorTest.timer._runTest();
 }
 
+InspectorTest.measureFunction = function(object, functionName)
+{
+    function measure() {
+        var timer = InspectorTest.timer;
+        var cookie;
+        if (timer)
+            cookie = timer.start(functionName);
+        var result = func.apply(this, arguments);
+
+        if (timer)
+            timer.finish(cookie);
+        return result;
+    }
+    var func = object[functionName];
+    object[functionName] = measure;
+}
+
 InspectorTest.mark = function(markerName)
 {
     var timer = InspectorTest.timer;