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

Issue 1317593003: createPlainText(): avoid a 32k buffer allocation for empty ranges. (Closed)

Created:
5 years, 4 months ago by sof
Modified:
5 years, 4 months ago
Reviewers:
tkent, haraken, yosin_UTC9
CC:
blink-reviews
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

createPlainText(): avoid a 32k buffer allocation for empty ranges. The pre-allocation of the StringBuilder is redundant if the range is empty, hence avoid. While here, simplify empty string builder testing also. R=yosin BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201212

Patch Set 1 #

Total comments: 4

Patch Set 2 : use early return instead #

Patch Set 3 : simplify empty builder testing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -5 lines) Patch
M Source/core/editing/iterators/TextIterator.cpp View 1 2 1 chunk +6 lines, -5 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
sof
please take a look.
5 years, 4 months ago (2015-08-25 14:49:33 UTC) #2
yosin_UTC9
I can read your intention, e.g. not to use redundant memory. However, it is better ...
5 years, 4 months ago (2015-08-26 01:23:21 UTC) #3
sof
(+Cc: haraken@ who wrote the perf improving patch referred to.) On 2015/08/26 01:23:21, Yosi_UTC9 wrote: ...
5 years, 4 months ago (2015-08-26 06:32:21 UTC) #4
sof
actually Cc: haraken@
5 years, 4 months ago (2015-08-26 06:39:07 UTC) #5
haraken
LGTM That 32 KB pre-allocation is important to avoid unnecessary reallocations & copyings while appending ...
5 years, 4 months ago (2015-08-26 06:55:21 UTC) #6
yosin_UTC9
LGTM Thanks for cleanup TextIterator.cpp!
5 years, 4 months ago (2015-08-26 07:02:33 UTC) #7
sof
On 2015/08/26 06:55:21, haraken wrote: > LGTM > > That 32 KB pre-allocation is important ...
5 years, 4 months ago (2015-08-26 07:06:15 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1317593003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1317593003/40001
5 years, 4 months ago (2015-08-26 07:09:36 UTC) #10
commit-bot: I haz the power
5 years, 4 months ago (2015-08-26 08:07:29 UTC) #11
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=201212

Powered by Google App Engine
This is Rietveld 408576698