forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove NodeListsNodeData when it's no longer needed
https://bugs.webkit.org/show_bug.cgi?id=107074 Reviewed by Darin Adler. PerformanceTests: Added a micro benchmark to see the benefit of removing NodeListsNodeData. The test traverses all elements in the html5 specification page and accesses childNodes. Don't enable this test for now since it's really a micro benchmark specifically designed to test this patch. * DOM/TraverseChildNodes.html: Added. * Skipped: Don't enable newly added test by default. * resources/results-template.html: Compare against the unscaled unit (e.g. "bytes") as opposed to scaled units such as "K bytes". * resources/runner.js: (.start): Moved the code to call currentTest.setup from measureRunsPerSecondOnce so that it'll be ran for all test types, namely of PerfTestRunner.measureTime. (.measureRunsPerSecondOnce): Source/WebCore: Remove NodeListsNodeData when the last node list is removed from it. If we detect that we have only one node list left in the data structure, we'll simply destroy the entire "this" object to free up the memory space. This reduced the memory usage of the micro benchmark by roughly 3%. Performance Tests: DOM/TraverseChildNodes.html * dom/Node.cpp: (WebCore::Node::clearNodeLists): Added. * dom/Node.h: * dom/NodeRareData.h: (WebCore::NodeListsNodeData::removeChildNodeList): (WebCore::NodeListsNodeData::removeCacheWithAtomicName): (WebCore::NodeListsNodeData::removeCacheWithName): (WebCore::NodeListsNodeData::removeCacheWithQualifiedName): (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList): Added. Removes "this" NodeListsNodeData if there is only one node list left. Tools: Generalize the warning a little so that it's also ignored on PerformanceTests/DOM/TraverseChildNodes.html * Scripts/webkitpy/performance_tests/perftest.py: (PerfTest): git-svn-id: svn://svn.chromium.org/blink/trunk@140070 bbb929c8-8fbe-4397-9dbb-9b2b20218538
- Loading branch information
rniwa@webkit.org
committed
Jan 18, 2013
1 parent
49285bc
commit 32776d2
Showing
11 changed files
with
131 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
third_party/WebKit/PerformanceTests/DOM/TraverseChildNodes.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script src="../resources/runner.js"></script> | ||
<script> | ||
var spec = PerfTestRunner.loadFile("../Parser/resources/html5.html"); | ||
var iframe; | ||
|
||
PerfTestRunner.measureTime({ | ||
setup: function () { | ||
if (iframe) | ||
document.body.removeChild(iframe); | ||
iframe = document.createElement("iframe"); | ||
iframe.style.display = "none"; // Prevent creation of the rendering tree, so we only test HTML parsing. | ||
iframe.sandbox = ''; // Prevent external script loads which could cause write() to return before completing the parse. | ||
document.body.appendChild(iframe); | ||
iframe.contentDocument.open(); | ||
iframe.contentDocument.write(spec); | ||
iframe.contentDocument.close(); | ||
}, | ||
run: function() { | ||
var elements = iframe.contentDocument.getElementsByTagName('*'); | ||
for (var i = 0; i < elements.length; i++) { | ||
for (var j = 0; j < elements[i].childNodes.length; j++) | ||
elements[i].childNodes[j]; | ||
} | ||
}, | ||
done: function () { document.body.removeChild(iframe); }}); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters