DescriptionRemove ASCIILiteral optimization from StringImpl
This CL removes the ASCIILiteral optimization from StringImpl. We now treat
literal strings the same as we treat non-literal strings, which is to say we
copy the into the StringImpl object instead of pointing to them in the heap.
ASCIILiteral is only remaining client of the pointer in StringImpl. Once we
remove this optimization, we can remove the pointer from StringImpl, which
saves 12 bytes on 64 architectures (8 bytes for the pointer itself and 4 bytes
of alignment).
Using a hacked up version of STRING_STATS, I evaluated how much memory the
ASCIILiteral optimiation saves. I compared the memory saved by not copying the
character data into the heap with the 12 bytes per StringImpl object that we'll
save by removing the pointer. To be conservative, I only counted the savings on
StringImpl objects that used the ASCIILiteral optimization.
Browsing around a number of typical web pages, I found that the ASCIILiteral
optimization typically saves about 600 bytes of memory. On some pages, the
ASCIILiteral "optimization" was actually a net negative (because the average
length of the literal strings was less than 12 characters).
This CL doesn't rip out all the callers of these functions. I'll do that in a
followup CL once this CL has been through all the performance bots.
R=eseidel
BUG=262320
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155278
Patch Set 1 #
Messages
Total messages: 4 (0 generated)
|