#10125 closed task (fixed)
parser and startup() refactor
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Parser | Version: | 1.4.0b |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The parser calls startup() on every widget that isn't parented by a _Container widget:
// Call startup on each top level instance if it makes sense (as for // widgets). Parent widgets will recursively call startup on their // (non-top level) children if(!mixin._started && !args.noStart){ d.forEach(thelist, function(instance){ if( instance && instance.startup && !instance._started && (!instance.getParent || !instance.getParent()) ){ instance.startup(); } }); }
This requires a getParent() call on every widget.
Seems like a waste of CPU cycles, especially for browsers w/out querySelectorAll(). On those browsers the parser (via a call to dojo.query()) is doing a top-down traversal of the DOM tree (looking for dojoType) so it would be free to keep track of parent-child relationships.
Benchmark that change to see if it speeds up or slows down the various browsers.
See also #10061.
Change History (3)
comment:1 Changed 11 years ago by
Milestone: | 1.5 → 2.0 |
---|
comment:2 Changed 9 years ago by
Milestone: | 2.0 → 1.7 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Actually, the getParent() call was removed in [26531].
Note: See
TracTickets for help on using
tickets.
Marking for 2.0 as per my comment in the code: