RESOLVED FIXED 75333
Reduce memory used by NamedNodeMap.
https://bugs.webkit.org/show_bug.cgi?id=75333
Summary Reduce memory used by NamedNodeMap.
Andreas Kling
Reported 2011-12-28 19:09:57 PST
The vast majority of attribute maps contain 4 or fewer attributes. Furthermore, an element with 0 attributes doesn't need an attribute map at all. With this in mind, we can give the attribute vector an inline capacity of 4 and avoid having the initial append() grow to 16 entries capacity.
Attachments
Proposed patch (1.31 KB, patch)
2011-12-28 19:28 PST, Andreas Kling
no flags
Andreas Kling
Comment 1 2011-12-28 19:28:51 PST
Created attachment 120714 [details] Proposed patch
Andreas Kling
Comment 2 2011-12-28 19:35:26 PST
For reference, attributes per NamedNodeMap (Alexa top sites): No NamedNodeMap allocated: 76.579% 0: 0.073% 1: 22.046% 2: 1.219% 3: 0.039% 4: 0.038% 5: 0.002% ... and then dwindling downwards up to 13 attributes.
Sam Weinig
Comment 3 2011-12-28 19:37:58 PST
Comment on attachment 120714 [details] Proposed patch Nice. r=me.
Andreas Kling
Comment 4 2011-12-28 19:56:32 PST
Comment on attachment 120714 [details] Proposed patch Clearing flags on attachment: 120714 Committed r103791: <http://trac.webkit.org/changeset/103791>
Andreas Kling
Comment 5 2011-12-28 19:56:41 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.