https://bugs.webkit.org/show_bug.cgi?id=89363
We have to track the performance of MemoryAgent.getProcessMemoryDistribution.
Also this test will work as a burn down chart for Unknown memory metric.
Reviewed by Pavel Feldman.
* inspector/native-memory-snapshot.html: Added.
* inspector/performance-test.js:
(initialize_TimeTracker.InspectorTest.runPerformanceTest.Timer):
(initialize_TimeTracker.InspectorTest.runPerformanceTest.Timer.prototype.reportSize):
(initialize_TimeTracker.InspectorTest.runPerformanceTest.Timer.prototype._dump):
(initialize_TimeTracker.InspectorTest.runPerformanceTest):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120618
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-06-18 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: native memory snapshot performance and coverage test implementation.
+ https://bugs.webkit.org/show_bug.cgi?id=89363
+
+ We have to track the performance of MemoryAgent.getProcessMemoryDistribution.
+ Also this test will work as a burn down chart for Unknown memory metric.
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/native-memory-snapshot.html: Added.
+ * inspector/performance-test.js:
+ (initialize_TimeTracker.InspectorTest.runPerformanceTest.Timer):
+ (initialize_TimeTracker.InspectorTest.runPerformanceTest.Timer.prototype.reportSize):
+ (initialize_TimeTracker.InspectorTest.runPerformanceTest.Timer.prototype._dump):
+ (initialize_TimeTracker.InspectorTest.runPerformanceTest):
+
2012-06-05 Alexei Filippov <alexeif@chromium.org>
Web Inspector: serialize edge counts instead of indexes in heap snapshot
--- /dev/null
+<html>
+<head>
+ <script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
+ <script src="performance-test.js"></script>
+<script>
+
+function test()
+{
+ function performanceTest(timer)
+ {
+ var testName = /([^\/]+)\.html$/.exec(WebInspector.inspectedPageURL)[1];
+ var takeTimerCookie = timer.start("take");
+ MemoryAgent.getProcessMemoryDistribution(dump);
+
+ function dump(e, data)
+ {
+ timer.finish(takeTimerCookie);
+ function reportSize(data)
+ {
+ timer.reportSize(data.name, data.size);
+ if (data.children) {
+ for (var i = 0; i < data.children.length; ++i)
+ reportSize(data.children[i]);
+ }
+ }
+ reportSize(data);
+ var knownSize = 0;
+ for (var i = 0; i < data.children.length; ++i)
+ knownSize += data.children[i].size;
+ timer.reportSize("Unknown", data.size - knownSize);
+ timer.done(testName);
+ }
+ }
+
+ InspectorTest.runPerformanceTest(performanceTest, 2000);
+}
+
+function createDOMTree(elementsCount)
+{
+ var root = document.getElementById("testTreeRoot");
+
+ for (var i = 0; i < elementsCount; ++i)
+ root.appendChild(document.createElement("span"));
+
+ for (var i = 0; i < elementsCount; ++i)
+ root.appendChild(document.createElement("div"));
+
+ for (var i = 0; i < elementsCount; ++i)
+ root.appendChild(document.createElement("a"));
+}
+
+setTimeout(createDOMTree.bind(null,1000), 0);
+
+</script>
+</head>
+<body onload="runTest()">
+ <div id="testTreeRoot">
+ </div>
+</body>
+</html>
this._callback = callback;
this._test = test;
this._times = {};
+ this._sizes = {};
this._testStartTime = new Date();
this._heapSizeDeltas = [];
this._jsHeapSize = this._getJSHeapSize();
this._times[cookie.name].push(endTime - cookie.startTime);
},
+ reportSize: function(name, size)
+ {
+ if (!this._sizes[name])
+ this._sizes[name] = [];
+ this._sizes[name].push(size);
+ },
+
_getJSHeapSize: function()
{
if (window.gc) {
for (var testName in this._times)
InspectorTest.dumpTestStats(groupName, testName, this._times[testName], "ms");
+ for (var testName in this._sizes)
+ InspectorTest.dumpTestStats(groupName, testName, this._sizes[testName], "kB", 1024);
+
var url = WebInspector.inspectedPageURL;
var regExp = /([^\/]+)\.html/;
var matches = regExp.exec(url);