Open Bug 1365475 Opened 7 years ago Updated 2 years ago

stylo: Complex selectors with multiple class selectors end up doing multiple FFI calls to get the class attr

Categories

(Core :: CSS Parsing and Computation, enhancement, P4)

53 Branch
enhancement

Tracking

()

Tracking Status
firefox57 --- wontfix

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

The way things are set up right now, each class selector causes a has_class call, which will go looking for the "class" attribute.  It sure would be nice if we either cached the result somewhere or coalesced multiple class simple selectors or something...

Gecko doesn't have this problem, since it automatically coalesces class simple selectors into a single call to GetClasses followed by work with the resulting list-or-atom.
Keywords: perf
One idea to fix this is using an `ElementMatchingContext` or something like that, and pass it down to the loop where we go through the selector sequence. Shouldn't be too hard I think.
Yeah seems like we should just use an LRU cache for id and class, and stick that on the existing MatchingContext;
Blocks: stylo-perf
Priority: -- → P4
status-firefox57=wontfix unless someone thinks this bug should block 57
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.