Closed Bug 1304244 Opened 8 years ago Closed 7 years ago

stylo: Consider grouping inherited and reset style struct pointers into intermediate structs

Categories

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

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bholley, Unassigned)

References

(Blocks 1 open bug)

Details

Whenever servo cascades a node, it clones all the inherited struct Arcs from its parent, and all the reset struct Arcs from the initial computed values. We could reduce this refcount traffic by having ComputedValues hold just two Arcs, one to an intermediate struct to hold the inherited Arc pointers, and another to an intermediate struct to hold the reset Arc pointers.

This would save us a bunch of atomic refcounting at the expense of some additional allocations and pointer-chasing during layout. It would also let the rule tree hold onto the inherited values but not the reset values.

I don't really know the relative cost of atomic refcount operations in comparison to the other work we'd be doing here. We could certainly measure, though Patrick might have some intuition on whether this is likely to be a win or not. Patrick?
Flags: needinfo?(pwalton)
An atomic refcount bump is a relaxed increment, so I don't expect this to be a major performance improvement, over all taking into account the extra indirection we'd be adding.
Priority: -- → P4
Atomic operations tend to be cheap on x86 and slow on ARMv7 and below because the "dmb ish" instruction is expensive. I haven't tested ARMv8, which has better barrier instructions.
Flags: needinfo?(pwalton)
I've gained better intuition about this stuff since I filed the bug, and I'm pretty sure that the extra L2 cache misses during layout from the indirection would outweigh the reduction in atomic ops.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.