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

Issue 316633002: Speed up identifying keywords in scanner, by using extra table. (Closed)

Created:
6 years, 6 months ago by Anders Johnsen
Modified:
6 years, 6 months ago
Reviewers:
iposva, hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Speed up identifying keywords in scanner, by using extra table. The table maps the first character of a identifier, to the first keyword intry in the sorted token-list. If no keyword exists that starts with a given character, we don't enter the loop at all. BUG= R=hausner@google.com Committed: https://code.google.com/p/dart/source/detail?r=36934

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -20 lines) Patch
M runtime/vm/scanner.h View 2 chunks +4 lines, -1 line 0 comments Download
M runtime/vm/scanner.cc View 1 3 chunks +28 lines, -17 lines 0 comments Download
M runtime/vm/symbols.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/token.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Anders Johnsen
This gives a slight speedup when scanning. Ivan, can you forward to the persons?
6 years, 6 months ago (2014-06-03 17:23:40 UTC) #1
hausner
DBC: have you measured a speedup using an actual program, e.g. compiling all of dart2js?
6 years, 6 months ago (2014-06-03 17:54:07 UTC) #2
hausner
Another DBC. https://codereview.chromium.org/316633002/diff/1/runtime/vm/scanner.cc File runtime/vm/scanner.cc (right): https://codereview.chromium.org/316633002/diff/1/runtime/vm/scanner.cc#newcode294 runtime/vm/scanner.cc:294: if (ch >= 0 && ch < ...
6 years, 6 months ago (2014-06-03 17:59:26 UTC) #3
Anders Johnsen
I'll work on getting some numbers as well. https://codereview.chromium.org/316633002/diff/1/runtime/vm/scanner.cc File runtime/vm/scanner.cc (right): https://codereview.chromium.org/316633002/diff/1/runtime/vm/scanner.cc#newcode294 runtime/vm/scanner.cc:294: if ...
6 years, 6 months ago (2014-06-03 18:52:59 UTC) #4
Anders Johnsen
Updated. Numbers (10 runs, sorted): Before: Dart2JSCompileAll(RunTime): 1344110 Dart2JSCompileAll(RunTime): 1349788 Dart2JSCompileAll(RunTime): 1355867 Dart2JSCompileAll(RunTime): 1366156 Dart2JSCompileAll(RunTime): ...
6 years, 6 months ago (2014-06-03 19:26:13 UTC) #5
hausner
Thank you. If I take the average before and after, it seems the speedup is ...
6 years, 6 months ago (2014-06-03 19:42:39 UTC) #6
hausner
LGTM, ship it!
6 years, 6 months ago (2014-06-03 20:08:26 UTC) #7
Anders Johnsen
6 years, 6 months ago (2014-06-03 20:15:52 UTC) #8
Message was sent while issue was closed.
Committed patchset #2 manually as r36934 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698