Closed Bug 1339703 Opened 8 years ago Closed 8 years ago

stylo: iter_declarations is slow

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bholley, Assigned: SimonSapin)

References

(Blocks 1 open bug)

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)
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
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.