Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: third_party/WebKit/PerformanceTests/Mutation/remove-child-with-ranges.html

Issue 2039113003: Make removeChild faster with active ranges (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-06T16:21:06 Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ContainerNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/PerformanceTests/Mutation/remove-child-with-ranges.html
diff --git a/third_party/WebKit/PerformanceTests/Mutation/append-child-with-ranges.html b/third_party/WebKit/PerformanceTests/Mutation/remove-child-with-ranges.html
similarity index 71%
copy from third_party/WebKit/PerformanceTests/Mutation/append-child-with-ranges.html
copy to third_party/WebKit/PerformanceTests/Mutation/remove-child-with-ranges.html
index 3795428eec51c908caaa9e7d0bfdbdaede076458..9683af86b67322b2815fff77bdd1bd6948122227 100644
--- a/third_party/WebKit/PerformanceTests/Mutation/append-child-with-ranges.html
+++ b/third_party/WebKit/PerformanceTests/Mutation/remove-child-with-ranges.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<!-- Identical to "append-child.html" but having 100 active ranges -->
+<!-- Identical to "remove-child.html" but having 100 active ranges -->
<body>
<pre id="log"></pre>
<script src="../resources/runner.js"></script>
@@ -10,7 +10,7 @@ for (var i = 0; i < 50000; ++i)
elems[i] = document.createElement('div');
var ranges = [];
-for (var i = 0; i < 100; ++i) {
+for (var i = 0; i < 1000; ++i) {
var range = new Range();
ranges[i] = range;
range.selectNodeContents(document.body);
@@ -19,10 +19,12 @@ for (var i = 0; i < 100; ++i) {
var sandbox = document.getElementById('sandbox');
PerfTestRunner.measureRunsPerSecond({
- description: 'Measures performance of appendChild with active Range objects',
+ description: 'Measures performance of removeChild with active Range objects',
run: function() {
for (var elem of elems)
sandbox.appendChild(elem);
+ while (sandbox.firstChild)
+ sandbox.firstChild.remove();
}
});
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ContainerNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698