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




2 years ago
a year ago


(Reporter: bzbarsky, Unassigned)


(Blocks: 2 bugs, {perf})

53 Branch
Dependency tree / graph

Firefox Tracking Flags

(firefox57 wontfix)


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.


2 years ago
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: 1289864
Priority: -- → P4
status-firefox57=wontfix unless someone thinks this bug should block 57
status-firefox57: --- → wontfix
You need to log in before you can comment on or make changes to this bug.