New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 619498 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Feature



Sign in to add a comment

CSSTokenizer should use inline capacity on the token vectors

Project Member Reported by esprehn@chromium.org, Jun 13 2016

Issue description

This is a large performance improvement when parsing inline styles, and cuts script execution time for Animometer.

See:
https://codereview.chromium.org/1920583002

where this combined with other optimizations got 35% improvement.

This should be pretty simple, see the linked patch.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf

commit 7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf
Author: timloh <timloh@chromium.org>
Date: Mon Jun 13 10:52:07 2016

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 

Review-Url: https://codereview.chromium.org/2058403002
Cr-Commit-Position: refs/heads/master@{#399426}

[modify] https://crrev.com/7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf/third_party/WebKit/Source/core/css/parser/CSSParserTokenRange.h
[modify] https://crrev.com/7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf/third_party/WebKit/Source/core/css/parser/CSSTokenizer.h

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf

commit 7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf
Author: timloh <timloh@chromium.org>
Date: Mon Jun 13 10:52:07 2016

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 

Review-Url: https://codereview.chromium.org/2058403002
Cr-Commit-Position: refs/heads/master@{#399426}

[modify] https://crrev.com/7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf/third_party/WebKit/Source/core/css/parser/CSSParserTokenRange.h
[modify] https://crrev.com/7d18ae343a06b83d460ee4084fa2f5bc0f1e4acf/third_party/WebKit/Source/core/css/parser/CSSTokenizer.h

Comment 3 by timloh@chromium.org, Jun 30 2016

Status: Fixed (was: Assigned)

Sign in to add a comment