dojo.query() is oddly slow in "~" child selectors on IE
Reported by: |
alex |
Owned by: |
alex |
Priority:
|
high
|
Milestone:
|
1.3
|
Component:
|
Query
|
Version:
|
1.1.1
|
Keywords:
|
|
Cc:
|
|
Blocked By:
|
|
Blocking:
|
|
on slickspeed, Dojo 1.1's query() has a huge outlier in terms of overall performance on the "~" adjacent child selector. This seems to be due to a toLowerCase() string call which gets run very often in the tag name matching filter.
Change History (8)
Milestone: |
1.2 →
1.3
|
Priority: |
normal →
high
|
severity: |
normal →
minor
|
Status: |
new →
assigned
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
I've tracked this down to selection of sibling selectors happening on the token on the left-hand side of the expression. So if we have an expression of ".thinger div ~ span", the engine will search for all items with a class of "thinger" and then will look for children which are divs. This leads to serious inefficiency since we're not "failing early, since we actually care to look at descendants which are *spans*, which are then modified by the "and are preceeded by a div as siblings" rule. A relatively large change to the tokenizer will be required to change the performance profile on this query, so given its relative infrequent use, I'm going to punt this to 1.3. We're still faster than all comers on queries that actually see day-to-day use, but I strongly agree that we should get this fixed soon.