#8024 closed bug (fixed)
Sizzle Performance Regression
Reported by: | Rick Waldron | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.5 |
Component: | selector | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
http://www.readwriteweb.com/hack/2011/01/jquery-upgrade-twitter.php
http://www.dustindiaz.com/about-that-slowness-on-twitter/
I just wanted to document these here, close if we have tickets
Change History (4)
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 12 years ago by
Component: | unfiled → selector |
---|---|
Milestone: | 1.next → 1.5 |
Priority: | undecided → blocker |
So yeah - this was from moving to using qSA in jQuery 1.4.3. qSA(".class") is slower than doing getElementsByClassName("class") (which is what Sizzle would use internally). Amusingly the case of jQuery(".class") would/has been always using qSA if possible so that would've been "slow" for them as well.
I've moved some perf improvements from jQuery into Sizzle and added a ".class" check and quickly use getElementsByClassName if it exists. This will help to make the code faster in all browsers (and for other projects that use Sizzle).
That sounds strange to me as 1.4.3 specifically included an update to Sizzle to improve the performance of element rooted queries. Also the blog post on the 1.4.3 release documents improvements on the performance of .find. Maybe we need a jsperf test on this