Opened 13 years ago
Closed 13 years ago
#3907 closed bug (wontfix)
poor performance in jquery-1.3 comparing to jquery-1.2.6
Reported by: | bagwg1127 | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.3.1 |
Component: | selector | Version: | 1.3 |
Keywords: | filter, selector | Cc: | bagwg1127 |
Blocked by: | Blocking: |
Description
http://www.finereport.com/jquerytest/jquery-1.2.6.html
construct ul:4129 $(">ul>li", "body"):4 filter expend:4
http://www.finereport.com/jquerytest/jquery-1.3.html
construct ul:4149 $(">ul>li", "body"):40 filter expend:399
Note: See
TracTickets for help on using
tickets.
Yep, this is known. Some selectors in 1.3 are slower, some are faster. In the case of your example you have the benefit of a single root element - which helps to speed up 1.2.6-style selector engines, but doesn't benefit 1.3 (which must look at all li elements then traverse their way back up. The more you're able to filter down on the initial query the faster it will be.
A couple changes: Remove the root of body (going against a root of document is faster). Why the initial > check in front of the ul? Removing that can speed things up as well.
I'm marking this as wontfix since this is mostly by the design of the engine.