Bug Tracker

Opened 12 years ago

Closed 11 years ago

#10697 closed bug (fixed)

Sizzle revamp

Reported by: Timmy Willison Owned by: Timmy Willison
Priority: blocker Milestone: 1.8
Component: selector Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by Timmy Willison)

This ticket is for tracking enhancements and reductions for Sizzle. Some of these may belong in separate tickets, but I need to compile the list somewhere. I plan on doing/researching all of this in 1.8.

These are my ideas so far:

  1. Reorganize the main Sizzle function to be one function that contains shortcuts for id, tag, class, and document.body and an internal select function that uses qsa if available. Sizzle somewhat does this already, but not completely. I think it would reduce the size of Sizzle itself. We also do some of this in jQuery.fn.init and duplicate some of what is already in a qsa Sizzle. This could remove the need for that duplication and shave even more bytes.
  2. This may not be feasible, but I want to look into adding local vars for the most common things referenced from within Sizzle instead of using.long.property.accesses internally.
  3. The implementation of prefilters seems a bit wet. I'd like to dry up some of that code and look into reducing the call stack on that codepath.
  4. Add a support-test regex builder for places in which we know QSA will fail, such as with :checked on select elements in webkit (there are about 6 others). This should not hurt performance at all if done correctly.
  5. Remove matchesSelector support completely. I know this sounds scary, but as Dave noticed in his event testing, even the native matchesSelector is really slow. It may actually be faster, especially in the most common use cases, to do our own filtering all the time. This could also remove the need for quickIs in event.js.
  6. Combine dirNodeCheck and dirCheck into a single function.
  7. Add a better fallback for Sizzle.contains.
  8. There are a couple tests for Opera 9.6 and Safari 3.2, which we don't support anymore, for getElementsByClassName. We could remove that cruft.
  9. Look into simplifying Sizzle's makeArray to not use Array slice at all. When building minimaljs, I noticed that a simple array builder is actually faster than using slice, so it does not seem worth it.
  10. Check how many bytes it would save to build the chunker and all other regexes using strings to reduce duplication.
  11. Follow spec for acceptable character ranges. Currently, we use "\u00c0-\uFFFF\", which may not be correct. third party pull https://github.com/jquery/sizzle/pull/61

Change History (15)

comment:1 Changed 12 years ago by Timmy Willison

Component: unfiledselector
Milestone: None1.8
Owner: set to Timmy Willison
Priority: undecidedblocker
Status: newassigned

comment:2 Changed 12 years ago by Rick Waldron

Keywords: 1.8-discuss added

+1 !!!!!!

comment:3 Changed 12 years ago by Timmy Willison

Description: modified (diff)

comment:4 Changed 12 years ago by mofle

+1 Awesome, sounds great!

comment:5 Changed 12 years ago by Timmy Willison

Description: modified (diff)

comment:6 Changed 11 years ago by dmethvin

Blocking: 7010 added

comment:7 Changed 11 years ago by mikesherov

Description: modified (diff)

+1, When people think jQuery, they think fast and simple selection. Sounds like this needs to be done.

comment:8 Changed 11 years ago by jzaefferer


comment:9 Changed 11 years ago by jaubourg


comment:10 Changed 11 years ago by dmethvin

Description: modified (diff)

+1, In the 1.8 theme, it would also be nice if item 1 could be isolated as a "tiny Sizzle" -- let's call it "Small Fry"?

comment:11 Changed 11 years ago by hkdobrev@…


comment:12 Changed 11 years ago by Rick Waldron


comment:13 Changed 11 years ago by dmethvin

#11109 is a duplicate of this ticket.

comment:14 Changed 11 years ago by Timmy Willison

Description: modified (diff)

Moving 12 and 13 to their own tickets.

comment:15 Changed 11 years ago by Timmy Willison

Blocking: 7010 removed
Keywords: 1.8-discuss removed
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.