[Webkit-unassigned] [Bug 67081] Basic enhancements to StringBuilder
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 29 03:13:45 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=67081
--- Comment #13 from Xianzhu Wang <wangxianzhu at chromium.org> 2011-09-29 03:13:45 PST ---
P.S. My opinion based on the analysis in #11 is:
Using AtomicString(toString()) and AtomicString(toStringPreserveCapacity()) as the implementation of toAtomicString() and toAtomicStringPreserveCapacity() (the A and B columns in the analysis table), the not good cases are:
1. AtomicString(toString()) when the string is already in the atomic string table, and the StringBuilder is much over-allocated. In this case, the shrinkToFit() might unnecessarily allocate new buffer and copy data.
2. AtomicString(toStringPreserveCapacity()) when the string is not in the atomic string table, and the StringBuilder is much over-allocated. In this case, the string put into the atomic string table will have unnecessary over-allocated buffer.
The other cases seem all good. Because we provide both toAtomicString() and toAtomicStringPreserveCapacity(), the caller can choose one that might have higher chance to avoid the extra cost.
--
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