[Webkit-unassigned] [Bug 69913] Use realloc() to expand/shrink StringBuilder buffer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 30 10:54:33 PST 2012


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


Yong Li <yong.li.webkit at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yong.li.webkit at gmail.com




--- Comment #9 from Yong Li <yong.li.webkit at gmail.com>  2012-01-30 10:54:31 PST ---
While it boosts performance, it also costs memory usage. Are we sure we really want it? Especially in shrinkToFit. In that function we check the length and see if we should shrink memory. When we decide to shrink memory, we are sure we want to create a new copy. But with your patch, it depends on how realloc is implemented. The more frequently you see realloc returns the same pointer, the more memory waste is happening. The buffer will not be destroyed when StringBuilder destructs in most cases, instead, it will be held by WTF::String object returned by toString, and can live with some JS object. So I suggest to revert this patch.

-- 
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