Title: [120618] trunk/PerformanceTests
- Revision
- 120618
- Author
- [email protected]
- Date
- 2012-06-18 12:53:38 -0700 (Mon, 18 Jun 2012)
Log Message
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):
Modified Paths
Added Paths
Diff
Modified: trunk/PerformanceTests/ChangeLog (120617 => 120618)
--- trunk/PerformanceTests/ChangeLog 2012-06-18 19:51:12 UTC (rev 120617)
+++ trunk/PerformanceTests/ChangeLog 2012-06-18 19:53:38 UTC (rev 120618)
@@ -1,3 +1,20 @@
+2012-06-18 Ilya Tikhonovsky <[email protected]>
+
+ 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 <[email protected]>
Web Inspector: serialize edge counts instead of indexes in heap snapshot
Added: trunk/PerformanceTests/inspector/native-memory-snapshot.html (0 => 120618)
--- trunk/PerformanceTests/inspector/native-memory-snapshot.html (rev 0)
+++ trunk/PerformanceTests/inspector/native-memory-snapshot.html 2012-06-18 19:53:38 UTC (rev 120618)
@@ -0,0 +1,60 @@
+<html>
+<head>
+ <script src=""
+ <script src=""
+<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>
Modified: trunk/PerformanceTests/inspector/performance-test.js (120617 => 120618)
--- trunk/PerformanceTests/inspector/performance-test.js 2012-06-18 19:51:12 UTC (rev 120617)
+++ trunk/PerformanceTests/inspector/performance-test.js 2012-06-18 19:53:38 UTC (rev 120618)
@@ -7,6 +7,7 @@
this._callback = callback;
this._test = test;
this._times = {};
+ this._sizes = {};
this._testStartTime = new Date();
this._heapSizeDeltas = [];
this._jsHeapSize = this._getJSHeapSize();
@@ -26,6 +27,13 @@
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) {
@@ -75,6 +83,9 @@
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 = ""
var regExp = /([^\/]+)\.html/;
var matches = regExp.exec(url);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes