The default bug view has changed. See this FAQ.

stylo: iter_declarations is slow

Assigned to



CSS Parsing and Computation
a month ago
14 days ago


(Reporter: bholley, Assigned: SimonSapin)


(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)


I spent some time today investigating the performance of the cascade. It's a bit hard to profile given the structure of the callgraph, but by my estimation we spend about 5% of the total cascade time in iter_declarations, and presumably a lot of that is acquiring the locks.

Simon, will your work on per-document locks solve this?
Flags: needinfo?(simon.sapin)

Comment 1

a month ago
Hopefully! It’s hard to say without trying it. I have a supporting library here: Next I’ll port the style system code to use it instead of per-CSSOM-object locks.
Flags: needinfo?(simon.sapin)
That's awesome! That work will allow us to stop pre-traversing the rule tree collecting lock guards, right?
Cool! Looking forward to seeing it in action. :-)

Assuming it works, I'd be in favor of iterating on it for a little bit in s/s, and then hoisting it to

+1 for removing our OwningHandle usage if we can, given the uncertainty in [1].

Assignee: nobody → simon.sapin
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.