[Webkit-unassigned] [Bug 67081] Basic enhancements to StringBuilder

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 14 04:20:14 PDT 2011


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


Xianzhu Wang <wangxianzhu at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #106970|0                           |1
        is obsolete|                            |
 Attachment #107317|                            |review?, commit-queue?
               Flag|                            |




--- Comment #8 from Xianzhu Wang <wangxianzhu at chromium.org>  2011-09-14 04:20:14 PST ---
Created an attachment (id=107317)
 --> (https://bugs.webkit.org/attachment.cgi?id=107317&action=review)
patch v3

After comparing the cost, I chose to use AtomicString(toString()) and AtomicString(toStringPreserveCapacity()) in toAtomicString() and toAtomicStringPreserveCapacity() respectively.

If they don't use toString() and toStringPreserveCapacity(), they still need shrinkToFit() (for toAtomicString()) and something like reifyString() (but without constructing a String). The difference is whether String::String(StringImpl*) or String::String(PassRefPtr<StringImpl>) will be called. The costs of the constructors are trivial, just like those of the constructors of RefPtr and PassRefPtr. The cached m_string might also benefit in some cases.

AtomicString(characters(), m_length) can get a fit-sized independent buffer, but I don't see obvious benefits of it.

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