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

Unified Diff: tools/dom/templates/html/impl/impl_Node.darttemplate

Issue 12382022: Speeding up Node.nodes.addAll (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Node.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index c312f77c61818217c1cef7636329563e549c827f..307cd0cea96e329577874641d1b269bf174c973d 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -70,7 +70,13 @@ $endif
void addAll(Iterable<Node> iterable) {
if (iterable is _ChildNodeListLazy) {
Siggi Cherem (dart-lang) 2013/02/28 19:43:32 is it worth doing this also for other types like L
blois 2013/02/28 20:45:58 The optimized loop requires that it be a browser n
Siggi Cherem (dart-lang) 2013/03/01 00:05:28 I see, thanks! - somehow the [0] below didn't sink
- iterable = new List.from(iterable);
+ if (iterable._this != _this) {
sra1 2013/03/01 01:17:59 if (!identical(iterable._this, _this))
+ // Optimized route for copying between nodes.
+ for (var i = 0, len = iterable.length; i < len; ++i) {
+ _this.$dom_appendChild(iterable[0]);
sra1 2013/03/01 01:17:59 iterable.first should be slightly faster.
sra1 2013/03/01 01:28:46 or, better, iterable._this.$dom_firstChild
+ }
+ }
+ return;
}
for (Node node in iterable) {
_this.$dom_appendChild(node);
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698