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

Issue 212603003: De-bloat SVGPathStringBuilder (Closed)

Created:
6 years, 9 months ago by fs
Modified:
6 years, 8 months ago
CC:
blink-reviews, adamk+blink_chromium.org, krit, Mikhail, abarth-chromium, ed+blinkwatch_opera.com, f(malita), gyuyoung.kim_webkit.org, Inactive, Stephen Chennney, kouhei+svg_chromium.org, rwlbuis
Visibility:
Public.

Description

De-bloat SVGPathStringBuilder For a class this meager, it was a bit of a heavy-weight: SVGPathStringBuilder::arcTo() clocked in at a whopping 7891 bytes (Linux, x86-64, gcc-4.8.2), but even the much simpler lineToVertical() used > .5k of text-space. Sacrifice the StringOperators-based pattern and use a cascade of functions instead. Besides reducing footprint, this also eliminates some of the copying that would occur between various temporary String objects. With the change in place, arcTo() dropped to 640 bytes (and lineToVertical got cut in half.) Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170523

Patch Set 1 #

Total comments: 1

Patch Set 2 : Generate directly in StringBuilder storage. #

Total comments: 4

Patch Set 3 : Drop ASSERT. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+104 lines, -56 lines) Patch
M Source/core/svg/SVGPathStringBuilder.cpp View 1 chunk +60 lines, -56 lines 0 comments Download
M Source/wtf/text/StringBuilder.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/wtf/text/StringBuilder.cpp View 1 2 2 chunks +30 lines, -0 lines 0 comments Download
M Source/wtf/text/StringBuilderTest.cpp View 1 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
fs
Some days I look at footprint/symbol sizes and notice odd things... This was one of ...
6 years, 9 months ago (2014-03-26 16:29:30 UTC) #1
abarth-chromium
https://codereview.chromium.org/212603003/diff/1/Source/wtf/text/StringBuilder.cpp File Source/wtf/text/StringBuilder.cpp (right): https://codereview.chromium.org/212603003/diff/1/Source/wtf/text/StringBuilder.cpp#newcode353 Source/wtf/text/StringBuilder.cpp:353: append(numberToFixedPrecisionString(number, precision, buffer, trailingZerosTruncatingPolicy == TruncateTrailingZeros)); This can be ...
6 years, 9 months ago (2014-03-26 16:52:30 UTC) #2
fs
On 2014/03/26 16:52:30, abarth wrote: > https://codereview.chromium.org/212603003/diff/1/Source/wtf/text/StringBuilder.cpp > File Source/wtf/text/StringBuilder.cpp (right): > > https://codereview.chromium.org/212603003/diff/1/Source/wtf/text/StringBuilder.cpp#newcode353 > ...
6 years, 9 months ago (2014-03-27 14:11:13 UTC) #3
Erik Dahlström (inactive)
https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilderTest.cpp File Source/wtf/text/StringBuilderTest.cpp (right): https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilderTest.cpp#newcode322 Source/wtf/text/StringBuilderTest.cpp:322: const double someNumber = 1.2345; String::number() uses precision=6 per ...
6 years, 9 months ago (2014-03-27 14:42:34 UTC) #4
fs
On 2014/03/27 14:42:34, Erik Dahlström wrote: > https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilderTest.cpp > File Source/wtf/text/StringBuilderTest.cpp (right): > > https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilderTest.cpp#newcode322 ...
6 years, 9 months ago (2014-03-27 15:40:44 UTC) #5
fs
abarth/others, PTAL
6 years, 9 months ago (2014-03-28 14:59:09 UTC) #6
abarth-chromium
Ok, you might have made this too clever, but I like it. LGTM https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilder.cpp File ...
6 years, 9 months ago (2014-03-28 17:41:43 UTC) #7
fs
https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilder.cpp File Source/wtf/text/StringBuilder.cpp (right): https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilder.cpp#newcode356 Source/wtf/text/StringBuilder.cpp:356: ASSERT(current == buffer); On 2014/03/28 17:41:43, abarth wrote: > ...
6 years, 8 months ago (2014-03-31 07:41:56 UTC) #8
pdr.
On 2014/03/31 07:41:56, fs wrote: > https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilder.cpp > File Source/wtf/text/StringBuilder.cpp (right): > > https://codereview.chromium.org/212603003/diff/20001/Source/wtf/text/StringBuilder.cpp#newcode356 > ...
6 years, 8 months ago (2014-03-31 16:19:31 UTC) #9
fs
The CQ bit was checked by fs@opera.com
6 years, 8 months ago (2014-04-01 06:52:42 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/212603003/40001
6 years, 8 months ago (2014-04-01 06:52:48 UTC) #11
commit-bot: I haz the power
6 years, 8 months ago (2014-04-01 07:20:12 UTC) #12
Message was sent while issue was closed.
Change committed as 170523

Powered by Google App Engine
This is Rietveld 408576698