Closed
Bug 1292370
Opened 8 years ago
Closed 7 years ago
stylo: reduce memory usage by replacing cached style struct pointers with a bitfield
Categories
(Core :: CSS Parsing and Computation, defect, P4)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
WORKSFORME
Tracking | Status | |
---|---|---|
firefox57 | --- | wontfix |
People
(Reporter: bholley, Unassigned)
References
(Blocks 1 open bug)
Details
Right now nsStyleContext has a bunch of pointers to the style structs. For the Gecko case this is necessary, because the style contexts own the style structs (modulo inheritance and sharing). But in Stylo, they're just a cache of a pointer we obtained via an FFI call to Servo_GetStyleFoo.
We should measure the overhead of the FFI call. If it's insignificant, we should just call through to query the value each time. If it matters, we can teach Gecko about the pointer offsets inside a ServoComputedValues and query them directly with some pointer arithmetic (and static_assert that we're getting it right).
We also use these pointers to indicate whether we've ever used the style information from a given style struct, which allows us to short-circuit a bunch of work in CalcStyleDifference. But we can do this by replacing an array of pointers with a bitfield, and save about 20 pointers worth of memory, which is nothing to sneeze at.
Reporter | ||
Updated•8 years ago
|
Blocks: stylo-memory
Updated•8 years ago
|
Priority: -- → P3
Reporter | ||
Comment 1•8 years ago
|
||
This will be a significant memory win, but we can't do it until after we drop support for the old style system.
Priority: P3 → P4
Comment 2•7 years ago
|
||
status-firefox57=wontfix unless someone thinks this bug should block 57
status-firefox57:
--- → wontfix
Comment 3•7 years ago
|
||
This has been done.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•