Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
We can save memory if we store Selectors in a <Selector, Selector> map at the
FileSystemStyleCache level, and reuse where we can.
The implementation will be similar to what we did in TRINIDAD-2025 where we reused
Style objects. Selector objects are only 16 bytes each, but each
FileSystemStyleCache$StylesImpl instance creates about 4500 of them for our complicated skin.
Before Selector sharing:
FSSC$Entry about 335K each of retained size.
FSSC$StylesImpl about 214K each of retained size
run a page in 3 diff browsers, and we have 13402 Selector objects, total 214K
retained size
After Selector sharing:
FSSC$Entry about 263K each of retained size.
FSSC$StylesImpl about 142K each of retained size
run a page in 3 diff browsers, and we have 4533 Selector objects using 72.5K
Retained Size