+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
{
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");
function step2()
{
timer.finish(showTimerCookie);
- timer.finish(allTimerCookie);
changeViewTimerCookie = timer.start("switch-to-containment-view");
InspectorTest.switchToView("Containment", cleanup);
}
function cleanup()
{
timer.finish(changeViewTimerCookie);
+ timer.finish(fullTimerCookie);
clearTimerCookie = timer.start("clear-snapshot");
ProfilerAgent.clearProfiles(done);
WebInspector.panels.profiles._reset();
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()">
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;