Bug Tracker

Modify

Ticket #3907 (closed bug: wontfix)

Opened 5 years ago

Last modified 5 years ago

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
Blocking: Blocked by:

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

Change History

comment:1 Changed 5 years ago by john

  • Status changed from new to closed
  • Resolution set to wontfix

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.