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

Issue 2585063002: Cache contains only ascii in StringImpl (Closed)

Created:
4 years ago by Charlie Harrison
Modified:
3 years, 11 months ago
Reviewers:
kinuko, esprehn
CC:
blink-reviews, blink-reviews-wtf_chromium.org, chromium-reviews, Mikhail
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cache contains only ascii in StringImpl This patch adds a lazily calculated value in StringImpl for whether the string contains only ascii characters. This avoids code that re-scans the same string many times. BUG=675493 Committed: https://crrev.com/36ecc9ec6ab699d9300f50fd4ca26030acad3e26 Cr-Commit-Position: refs/heads/master@{#441535}

Patch Set 1 #

Patch Set 2 : cache contains only ascci #

Total comments: 1

Patch Set 3 : reviews #

Total comments: 22

Patch Set 4 : esprehn review #

Patch Set 5 : DCHECK + static_Cast #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -11 lines) Patch
M third_party/WebKit/Source/wtf/text/ASCIIFastPath.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/StringImpl.h View 1 2 3 4 10 chunks +22 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/StringImpl.cpp View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/WTFString.h View 1 2 2 chunks +3 lines, -11 lines 0 comments Download

Messages

Total messages: 39 (27 generated)
Charlie Harrison
esprehn, kinuko: here's the patch to cache containsOnlyASCII at StringImpl layer. There's some funkiness with ...
4 years ago (2016-12-22 14:24:14 UTC) #15
kinuko
https://codereview.chromium.org/2585063002/diff/20001/third_party/WebKit/Source/wtf/text/StringImpl.h File third_party/WebKit/Source/wtf/text/StringImpl.h (right): https://codereview.chromium.org/2585063002/diff/20001/third_party/WebKit/Source/wtf/text/StringImpl.h#newcode554 third_party/WebKit/Source/wtf/text/StringImpl.h:554: : charactersAreAllASCII(characters16(), length())); I'd defer the judgement to esprehn ...
3 years, 12 months ago (2016-12-26 07:32:19 UTC) #16
esprehn
Since you're using two bits anyway you can use one bit for m_needsAsciiCheck and another ...
3 years, 12 months ago (2016-12-26 19:33:56 UTC) #17
Charlie Harrison
On 2016/12/26 19:33:56, esprehn wrote: > Since you're using two bits anyway you can use ...
3 years, 11 months ago (2017-01-03 16:28:43 UTC) #18
esprehn
https://codereview.chromium.org/2585063002/diff/40001/third_party/WebKit/Source/wtf/text/StringImpl.h File third_party/WebKit/Source/wtf/text/StringImpl.h (right): https://codereview.chromium.org/2585063002/diff/40001/third_party/WebKit/Source/wtf/text/StringImpl.h#newcode137 third_party/WebKit/Source/wtf/text/StringImpl.h:137: m_containsOnlyASCII(false), true https://codereview.chromium.org/2585063002/diff/40001/third_party/WebKit/Source/wtf/text/StringImpl.h#newcode138 third_party/WebKit/Source/wtf/text/StringImpl.h:138: m_needsASCIICheck(true), false https://codereview.chromium.org/2585063002/diff/40001/third_party/WebKit/Source/wtf/text/StringImpl.h#newcode155 third_party/WebKit/Source/wtf/text/StringImpl.h:155: m_containsOnlyASCII(false), ...
3 years, 11 months ago (2017-01-04 20:30:38 UTC) #19
Charlie Harrison
Thanks! https://codereview.chromium.org/2585063002/diff/40001/third_party/WebKit/Source/wtf/text/StringImpl.h File third_party/WebKit/Source/wtf/text/StringImpl.h (right): https://codereview.chromium.org/2585063002/diff/40001/third_party/WebKit/Source/wtf/text/StringImpl.h#newcode137 third_party/WebKit/Source/wtf/text/StringImpl.h:137: m_containsOnlyASCII(false), On 2017/01/04 20:30:37, esprehn wrote: > true ...
3 years, 11 months ago (2017-01-04 20:53:51 UTC) #22
esprehn
lgtm, I think you might want to add an if (!length) return true; check to ...
3 years, 11 months ago (2017-01-04 20:57:50 UTC) #23
esprehn
On 2017/01/04 at 20:57:50, esprehn wrote: > lgtm, I think you might want to add ...
3 years, 11 months ago (2017-01-04 20:58:23 UTC) #24
Charlie Harrison
Added the DCHECK. I also had to static_cast<bool>(length) to initialize m_needsASCIICheck, as m_needsASCIICheck(unsigned) does not ...
3 years, 11 months ago (2017-01-04 21:43:29 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2585063002/80001
3 years, 11 months ago (2017-01-04 21:47:28 UTC) #34
commit-bot: I haz the power
Committed patchset #5 (id:80001)
3 years, 11 months ago (2017-01-05 00:53:10 UTC) #37
commit-bot: I haz the power
3 years, 11 months ago (2017-01-05 00:56:51 UTC) #39
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/36ecc9ec6ab699d9300f50fd4ca26030acad3e26
Cr-Commit-Position: refs/heads/master@{#441535}

Powered by Google App Engine
This is Rietveld 408576698