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

Issue 2188153002: Speed up parsing w/ grammar shortcut. (Closed)

Created:
4 years, 4 months ago by vogelheim
Modified:
4 years, 4 months ago
Reviewers:
adamk, marja
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Speed up parsing w/ grammar shortcut. Certain token combinations (e.g. number literal followed by semicolon) will result in a single AST node, but require many levels of recursive descent parsing to determine this (11 in this example). For some 'obvious' combinations, we'll simply generate the appropriate AST node fairly far up in the call tree. This yields a mild but consistent parser speedup. The main con is code duplication. [Speedup between 0..20ms in parse time among a set of 25 commonly used sites. Speedup of ~180ms for a site w/ a very large codebase (adwords.google.com). Minor slow-downs between 0..8ms for <20% of sites.] R=marja@chromium.org BUG=v8:4947 Committed: https://crrev.com/7a100dffc669a1e261831a37dbe67d2a9f8075fa Cr-Commit-Position: refs/heads/master@{#38591}

Patch Set 1 #

Patch Set 2 : Formatting fix. #

Total comments: 4

Patch Set 3 : Seperate function. #

Patch Set 4 : Fix PreParserTraits::EmptyExpression #

Total comments: 7

Patch Set 5 : Review feedback. #

Patch Set 6 : Rebase. #

Patch Set 7 : Reduced code duplication. #

Total comments: 3

Patch Set 8 : Review feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -4 lines) Patch
M src/parsing/parser-base.h View 1 2 3 4 5 6 7 4 chunks +30 lines, -4 lines 0 comments Download

Messages

Total messages: 47 (29 generated)
vogelheim
Please have a look. https://codereview.chromium.org/2188153002/diff/40001/src/parsing/parser-base.h File src/parsing/parser-base.h (left): https://codereview.chromium.org/2188153002/diff/40001/src/parsing/parser-base.h#oldcode1554 src/parsing/parser-base.h:1554: return this->ExpressionFromLiteral(Next(), beg_pos, scanner(), factory()); ...
4 years, 4 months ago (2016-07-28 09:35:02 UTC) #4
marja
lgtm from my part, relaying parts to adamk@. https://codereview.chromium.org/2188153002/diff/40001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2188153002/diff/40001/src/parsing/parser-base.h#newcode2278 src/parsing/parser-base.h:2278: // ...
4 years, 4 months ago (2016-07-28 10:01:29 UTC) #6
vogelheim
https://codereview.chromium.org/2188153002/diff/40001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2188153002/diff/40001/src/parsing/parser-base.h#newcode2278 src/parsing/parser-base.h:2278: // Parser shortcut: The following scope is a micro-optimization ...
4 years, 4 months ago (2016-07-28 12:54:59 UTC) #9
adamk
In your CL description, can you quantify the "mild but consistent parser speedup" (how mild? ...
4 years, 4 months ago (2016-07-28 17:51:55 UTC) #16
marja
https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h#newcode2283 src/parsing/parser-base.h:2283: if (!Traits::IsEmptyExpression(trivial_result)) return trivial_result; Ah right, since we have ...
4 years, 4 months ago (2016-07-29 07:56:04 UTC) #17
vogelheim
https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h#newcode2283 src/parsing/parser-base.h:2283: if (!Traits::IsEmptyExpression(trivial_result)) return trivial_result; On 2016/07/29 07:56:04, marja wrote: ...
4 years, 4 months ago (2016-08-09 11:26:08 UTC) #25
vogelheim
On 2016/07/28 17:51:55, adamk wrote: > In your CL description, can you quantify the "mild ...
4 years, 4 months ago (2016-08-09 11:27:28 UTC) #26
marja
lgtm
4 years, 4 months ago (2016-08-09 11:30:26 UTC) #27
adamk
https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h#newcode2310 src/parsing/parser-base.h:2310: ExpressionT expression = this->ParseConditionalExpression( On 2016/08/09 11:26:08, vogelheim wrote: ...
4 years, 4 months ago (2016-08-09 16:39:16 UTC) #30
vogelheim
On 2016/08/09 16:39:16, adamk wrote: > https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h > File src/parsing/parser-base.h (right): > > https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h#newcode2310 > ...
4 years, 4 months ago (2016-08-10 17:17:19 UTC) #31
adamk
On 2016/08/10 17:17:19, vogelheim wrote: > On 2016/08/09 16:39:16, adamk wrote: > > > https://codereview.chromium.org/2188153002/diff/80001/src/parsing/parser-base.h ...
4 years, 4 months ago (2016-08-10 17:59:20 UTC) #32
vogelheim
On 2016/08/10 17:59:20, adamk wrote: > On 2016/08/10 17:17:19, vogelheim wrote: > > On 2016/08/09 ...
4 years, 4 months ago (2016-08-11 13:50:38 UTC) #33
adamk
Wow, this is much more appealing! lgtm besides one comment on if/else vs ternary operator. ...
4 years, 4 months ago (2016-08-11 17:11:05 UTC) #34
vogelheim
https://codereview.chromium.org/2188153002/diff/140001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2188153002/diff/140001/src/parsing/parser-base.h#newcode2317 src/parsing/parser-base.h:2317: if (!*ok) return this->EmptyExpression(); On 2016/08/11 17:11:05, adamk wrote: ...
4 years, 4 months ago (2016-08-11 17:44:08 UTC) #37
adamk
lgtm! https://codereview.chromium.org/2188153002/diff/140001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2188153002/diff/140001/src/parsing/parser-base.h#newcode2317 src/parsing/parser-base.h:2317: if (!*ok) return this->EmptyExpression(); On 2016/08/11 17:44:08, vogelheim ...
4 years, 4 months ago (2016-08-11 17:50:15 UTC) #38
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/2188153002/160001
4 years, 4 months ago (2016-08-11 18:15:36 UTC) #43
commit-bot: I haz the power
Committed patchset #8 (id:160001)
4 years, 4 months ago (2016-08-11 18:17:18 UTC) #45
commit-bot: I haz the power
4 years, 4 months ago (2016-08-11 18:17:37 UTC) #47
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/7a100dffc669a1e261831a37dbe67d2a9f8075fa
Cr-Commit-Position: refs/heads/master@{#38591}

Powered by Google App Engine
This is Rietveld 408576698