performance: decrease memory of FileSystemStyleCache by reusing CSSStyle
objects.
---------------------------------------------------------------------------------
Key: TRINIDAD-1702
URL: https://issues.apache.org/jira/browse/TRINIDAD-1702
Project: MyFaces Trinidad
Issue Type: Improvement
Components: Skinning
Affects Versions: 1.2.13-core
Reporter: Jeanne Waldman
Assignee: Jeanne Waldman
Attachments: CSSStyleKeyPatch12122.patch
Our performance team gave me the following statistics:
Objects:
Shallow Heap Retained
Heap
SkinStyleProvider 13 723B
540M
FileSystemStyleCache$Entry 71 1704B 536M
FileSystemStyleCache$StyleImpl 71 2272B 533M
CSSStyle 315,431 7.5M
518M
The application they are testing has 13 skins, therefore there are 13
SkinStyleProvider objects.
Each css file has about 4500 selectors in this use case.
In FileSystemStyleCache's StyleImpl, we create a new CSSStyle object for every
selector, even though many of the selectors have the same css property
names/values. E.g., .af_inputText_xyz, .af_selectOneChoice_xyz,
.af_selectManyCheckbox_xyz {font-weight: bold; color: black}
To decrease the memory used, in StyleImpl we can reuse CSSStyle objects where
they have the same css property name and values. This small change saves 56% of
the memory used.
(Note: More memory should be saved in other ways, but this will be a different
JIRA issue).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.