[Webkit-unassigned] [Bug 72404] Could save a lot of memory in CharacterData by not always storing a String

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 1 16:17:15 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=72404





--- Comment #12 from Erik Arvidsson <arv at chromium.org>  2011-12-01 16:17:14 PST ---
(In reply to comment #11)
> (In reply to comment #10)
> > - Use 1 bit in NodeFlags (currently 2 remaining) to determine whether we have a white space node or not.
> > - Use an AlignedBuffer<sizeof(String), WTF_ALIGN_OF(String)>
> > - Add an assert that sizeof(String) == sizeof(AtomicString)
> > - Based on the flag return a String or AtomicString.
> 
> If the two different things you are storing as a union either a String or an AtomicString, then I think you are over-engineering this. The StringImpl object already has a flag in it that tells whether it is in the AtomicString table, and simply constructing an AtomicString then storing it in a String accomplishes what you want to do, making it share a single unique copy.

I was just about to upload a WIP patch that uses AlignedBuffer. It saves about 10megs (5%) on the HTML5.

I'll still upload it for people to look at but I'll investigate the String/AtomicString case too.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list