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

Issue 1420103006: Shared token objects (Closed)

Created:
5 years, 1 month ago by hausner
Modified:
5 years, 1 month ago
Reviewers:
siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Shared token objects Instead of one array for literal and identifier tokens for each TokenStream, share one array among all TokenStreams in an isolate. The shared array and the token-to-index map is stored in the object store until the embedder is done loading. Then the map is thrown away (and the array remains shared, referred to by the TokenStreams). When new files get loaded, a new shared array is created. For temporary scripts, e.g. when evaluating one-shot functions, the token arrays are not shared. This eliminates many duplicate LiteralToken and identifier tokens. Looking at the core libraries: Before: 30877 identifiers and 9618 literal tokens After: 12899 identifiers and 6371 literal tokens BUG= R=asiva@google.com Committed: https://github.com/dart-lang/sdk/commit/59dce43dfebd40b5881c8c1ae3dd30622897f0f8

Patch Set 1 #

Patch Set 2 : cleanup #

Total comments: 8

Patch Set 3 : catch up #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -72 lines) Patch
M runtime/vm/compiler_stats.h View 1 chunk +0 lines, -2 lines 0 comments Download
M runtime/vm/compiler_stats.cc View 4 chunks +0 lines, -11 lines 0 comments Download
M runtime/vm/isolate.cc View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/object.h View 1 2 4 chunks +10 lines, -5 lines 0 comments Download
M runtime/vm/object.cc View 1 2 11 chunks +113 lines, -48 lines 0 comments Download
M runtime/vm/object_store.h View 1 2 chunks +16 lines, -0 lines 0 comments Download
M runtime/vm/object_store.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/object_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/raw_object.h View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/snapshot.h View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/snapshot.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/snapshot_test.cc View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 7 (3 generated)
hausner
5 years, 1 month ago (2015-10-27 22:26:42 UTC) #4
siva
LGTM. https://chromiumcodereview.appspot.com/1420103006/diff/20001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://chromiumcodereview.appspot.com/1420103006/diff/20001/runtime/vm/object.cc#newcode8358 runtime/vm/object.cc:8358: static const bool kPrintTokenObjects = false; Instead of ...
5 years, 1 month ago (2015-10-28 18:30:23 UTC) #5
hausner
Thank you. Running dart --trace_isolates tests/language/hello_dart_test.dart I get the following measurements: vm isolate snapshot size: ...
5 years, 1 month ago (2015-10-28 21:28:46 UTC) #6
hausner
5 years, 1 month ago (2015-10-28 23:03:10 UTC) #7
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
59dce43dfebd40b5881c8c1ae3dd30622897f0f8 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698