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

Issue 1996343003: Add an early abort for the CSSParserFastPaths transform path. (Closed)

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

Description

Add an early abort for the CSSParserFastPaths transform path. For transforms that miss the fast path like "transform(1px, 1px) rotate(1deg)" we end up spending a lot of time building the transform list and doing string to double conversions for the function calls we do understand that were listed before the ones we didn't understand. This work ends up wasted and we have to redo it all inside the real CSSParser later. This patch introduces a scan over the string that tries to reject all transform things we don't understand in advance. This is not the best, since ideally we'd just remove the fast path and make the real parser just as fast, but in the meantime this at least avoids doing lots of wasted work. This patch makes the script in Animometer > Leaves 8% faster. The change is covered by the tests introduced in: https://codereview.chromium.org/2007823002 This was originally committed as: https://crrev.com/ad21c7423bc912e4c5287204d7c1eb57b994099a but contained a bug where we were doing WTF::find() + 1 which meant that when the string was not found we'd end up doing unsigned(-1) + 1 which wraps around to 0 causing an infinite loop. I fixed it by checking for kNotFound explicitly. BUG=606211 Committed: https://crrev.com/1e57a010caf64fcc35b942644e466220176a0d05 Cr-Commit-Position: refs/heads/master@{#396338}

Patch Set 1 #

Patch Set 2 : do it right. #

Patch Set 3 : simpler. #

Patch Set 4 : Add tests, also remove parseKeywordValue from the profile. #

Patch Set 5 : Break out other opts. #

Patch Set 6 : Handle missing parens correctly. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -12 lines) Patch
M third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp View 1 2 3 4 5 3 chunks +58 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserFastPathsTest.cpp View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (20 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1996343003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1996343003/40001
4 years, 7 months ago (2016-05-21 00:30:21 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-21 01:47:43 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1996343003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1996343003/80001
4 years, 7 months ago (2016-05-24 23:18:55 UTC) #11
esprehn
4 years, 7 months ago (2016-05-24 23:19:21 UTC) #13
dstockwell
lgtm
4 years, 7 months ago (2016-05-25 03:24:20 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1996343003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1996343003/80001
4 years, 7 months ago (2016-05-25 03:56:39 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 7 months ago (2016-05-25 04:14:05 UTC) #19
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/ad21c7423bc912e4c5287204d7c1eb57b994099a Cr-Commit-Position: refs/heads/master@{#395797}
4 years, 7 months ago (2016-05-25 04:15:08 UTC) #21
RobertoCN
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/2009723003/ by robertocn@chromium.org. ...
4 years, 7 months ago (2016-05-25 19:18:37 UTC) #22
esprehn
timloh@ Want to look at this again? I fixed my bug and added a test. ...
4 years, 7 months ago (2016-05-26 20:52:48 UTC) #23
Timothy Loh
On 2016/05/26 20:52:48, esprehn wrote: > timloh@ Want to look at this again? I fixed ...
4 years, 7 months ago (2016-05-26 21:54:16 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1996343003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1996343003/100001
4 years, 7 months ago (2016-05-26 22:08:41 UTC) #28
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-27 00:57:19 UTC) #30
commit-bot: I haz the power
Dry run: None
4 years, 7 months ago (2016-05-27 00:57:37 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1996343003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1996343003/100001
4 years, 7 months ago (2016-05-27 01:01:06 UTC) #34
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 7 months ago (2016-05-27 01:07:12 UTC) #35
commit-bot: I haz the power
4 years, 7 months ago (2016-05-27 01:09:15 UTC) #37
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/1e57a010caf64fcc35b942644e466220176a0d05
Cr-Commit-Position: refs/heads/master@{#396338}

Powered by Google App Engine
This is Rietveld 408576698