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

Issue 2058403002: Use an inline capacity for CSSTokenizer's Vector<CSSParserToken> (Closed)

Created:
4 years, 6 months ago by Timothy Loh
Modified:
4 years, 6 months ago
Reviewers:
meade_UTC10, esprehn
CC:
chromium-reviews, blink-reviews-css, dglazkov+blink, apavlov+blink_chromium.org, darktears, blink-reviews, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use an inline capacity for CSSTokenizer's Vector<CSSParserToken> This patch adds an inline capacity of 32 to CSSTokenizer's vector of parser tokens. This improves performance of parsing short pieces of CSS, for example setting inline styles, as we don't need to allocate memory for this vector. The capacity of 32 is chosen arbitrarily to accomodate most uses of inline styles (we reserve an initial capacity of length/3). This patch makes setting inline transforms to strings that miss the fast path ~2% faster on my z620. Note that this is not a reliable testing device, but we still expect that this optimisation improves performance. BUG=619498 Committed: https://crrev.com/7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf Cr-Commit-Position: refs/heads/master@{#399426}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -2 lines) Patch
M third_party/WebKit/Source/core/css/parser/CSSParserTokenRange.h View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSTokenizer.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 14 (5 generated)
Timothy Loh
Numbers from my z620 are not as large as I expected but I haven't set ...
4 years, 6 months ago (2016-06-13 09:53:44 UTC) #3
esprehn
On 2016/06/13 at 09:53:44, timloh wrote: > Numbers from my z620 are not as large ...
4 years, 6 months ago (2016-06-13 09:59:45 UTC) #4
Timothy Loh
On 2016/06/13 09:59:45, esprehn wrote: > On 2016/06/13 at 09:53:44, timloh wrote: > > Numbers ...
4 years, 6 months ago (2016-06-13 10:07:34 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2058403002/1
4 years, 6 months ago (2016-06-13 10:07:55 UTC) #7
Timothy Loh
On 2016/06/13 10:07:34, Timothy Loh wrote: > On 2016/06/13 09:59:45, esprehn wrote: > > On ...
4 years, 6 months ago (2016-06-13 10:08:28 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 6 months ago (2016-06-13 10:52:19 UTC) #10
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-13 10:52:24 UTC) #11
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf Cr-Commit-Position: refs/heads/master@{#399426}
4 years, 6 months ago (2016-06-13 10:54:41 UTC) #13
esprehn
4 years, 6 months ago (2016-06-13 11:56:13 UTC) #14
Message was sent while issue was closed.
On 2016/06/13 at 10:08:28, timloh wrote:
> On 2016/06/13 10:07:34, Timothy Loh wrote:
> > On 2016/06/13 09:59:45, esprehn wrote:
> > > On 2016/06/13 at 09:53:44, timloh wrote:
> > > > Numbers from my z620 are not as large as I expected but I haven't set it
up
> > as
> > > a perf testing machine so the actual change could be bigger or smaller.
> > > 
> > > The Z620 can give some very strange results if your benchmark is too fast,
> > > what's your benchmark? You could try running perf+pprof against the
> > > Leaves>Animometer benchmark if you want to check. I think this is good
change
> > > either way though, we should land it.
> > 
> > It sets translate on inline style in a loop some numbers of times (takes
about
> > 10s). I alternated running with and without the change a few times.
> 
> It's just a slightly modified version of what you uploaded to 605792

Btw I see Vector<CSSParserTokenType> m_blockStack; also show up in profiles,
that's block nesting like @media { .foo { } } ? We should probably add a small
inline capacity there too.

Powered by Google App Engine
This is Rietveld 408576698