RESOLVED FIXED 75315
Reduce memory used by SpaceSplitString.
https://bugs.webkit.org/show_bug.cgi?id=75315
Summary Reduce memory used by SpaceSplitString.
Andreas Kling
Reported 2011-12-28 08:53:31 PST
WebCore/dom/SpaceSplitString, used primarily for element class names, is quite wasteful memory wise. We could get massive gains with some simple trickery..
Attachments
Proposed patch (6.39 KB, patch)
2011-12-28 09:02 PST, Andreas Kling
no flags
Proposed patch v2 (6.20 KB, patch)
2011-12-28 15:47 PST, Andreas Kling
no flags
Andreas Kling
Comment 1 2011-12-28 09:02:47 PST
Created attachment 120679 [details] Proposed patch
Sam Weinig
Comment 2 2011-12-28 09:39:53 PST
Comment on attachment 120679 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=120679&action=review > Source/WebCore/dom/SpaceSplitString.h:75 > + Vector<AtomicString>* m_vector; This Vector used to have an inline capacity of 8, which I remember being a speedup at one point.
Andreas Kling
Comment 3 2011-12-28 13:10:21 PST
I instrumented the Alexa top sites to find out how many substrings we normally find in the class attribute, here are the results (number of substrings: percentage of class attributes): 1: 64.20% 2: 25.64% 3: 6.15% 4: 2.28% 5: 0.95% 6: 0.35% 7: 0.21% 8: 0.13% 9: 0.06% 10: 0.08% 11: 0.03% 12: 0.01% Given this data, I think we can reduce the inline capacity down to 2 where we'd save good amounts of memory and still cover 90% of cases.
Andreas Kling
Comment 4 2011-12-28 15:47:11 PST
Created attachment 120705 [details] Proposed patch v2
Sam Weinig
Comment 5 2011-12-28 19:39:38 PST
Comment on attachment 120705 [details] Proposed patch v2 I like it.
WebKit Review Bot
Comment 6 2011-12-28 19:46:34 PST
Comment on attachment 120705 [details] Proposed patch v2 Attachment 120705 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/10993749 New failing tests: http/tests/inspector/resource-tree/resource-tree-document-url.html
Andreas Kling
Comment 7 2011-12-28 19:54:53 PST
Comment on attachment 120705 [details] Proposed patch v2 Clearing flags on attachment: 120705 Committed r103790: <http://trac.webkit.org/changeset/103790>
Andreas Kling
Comment 8 2011-12-28 19:55:03 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.