stylo: iter_declarations is slow

RESOLVED FIXED

Status

()

Core
CSS Parsing and Computation
P1
normal
RESOLVED FIXED
6 months ago
5 months ago

People

(Reporter: bholley, Assigned: SimonSapin)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

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)
(Assignee)

Comment 1

6 months ago
Hopefully! It’s hard to say without trying it. I have a supporting library here: https://github.com/servo/servo/compare/arc-shared-rw-lock 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 crates.io.

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

[1] https://github.com/Kimundi/owning-ref-rs/pull/15
Assignee: nobody → simon.sapin
Priority: -- → P1
(Assignee)

Comment 4

5 months ago
I think https://github.com/servo/servo/pull/16014 fixed this.
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.