Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Issue 21274008: Remove ASCIILiteral optimization from StringImpl (Closed)

Created:
7 years, 4 months ago by abarth-chromium
Modified:
7 years, 4 months ago
Reviewers:
eseidel
CC:
blink-reviews, loislo+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, abarth-chromium, dglazkov+blink, adamk+blink_chromium.org, jeez
Visibility:
Public.

Description

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -198 lines) Patch
D Source/wtf/tests/AtomicString.cpp View 1 chunk +0 lines, -58 lines 0 comments Download
M Source/wtf/tests/StringImpl.cpp View 1 chunk +2 lines, -65 lines 0 comments Download
M Source/wtf/text/AtomicString.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/StringImpl.h View 5 chunks +0 lines, -33 lines 0 comments Download
M Source/wtf/text/StringImpl.cpp View 3 chunks +0 lines, -17 lines 0 comments Download
M Source/wtf/text/WTFString.h View 4 chunks +13 lines, -18 lines 0 comments Download
M Source/wtf/text/WTFString.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M Source/wtf/wtf.gypi View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
abarth-chromium
7 years, 4 months ago (2013-07-31 19:53:57 UTC) #1
eseidel
lgtm
7 years, 4 months ago (2013-07-31 20:07:17 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/abarth@chromium.org/21274008/1
7 years, 4 months ago (2013-07-31 20:07:33 UTC) #3
commit-bot: I haz the power
7 years, 4 months ago (2013-07-31 23:06:31 UTC) #4
Message was sent while issue was closed.
Change committed as 155278

Powered by Google App Engine
This is Rietveld 408576698