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

Issue 2847343002: Add support for profile-based startup optimizations. (Closed)

Created:
3 years, 7 months ago by floitsch
Modified:
3 years, 7 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add support for profile-based startup optimizations. An experimental (and undocumented) flag '--experimental-track-allocations' makes the '--fast-startup' compiler add instructions that track which classes are allocated. By going to the JavaScript console and dumping this information as JSON into `allocated_classes_profile` the next dart2js compilation can optimize the startup by deferring the initialization of the classes that weren't necessary for startup. The workflow would look something like: ``` dart2js --fast-startup --experimental-track-allocations -o foo.js -o foo.dart // Run the program in Chrome and run the following command in the console: JSON.stringify($__dart_deferred_initializers__.allocations) // Take the result and copy it into a file, say "allocations.json". // Then rerun the compilation with the allocation-information. dart2js --experimental-allocations-path=allocations.json --fast-startup -o foo.js -o foo.dart ``` R=sra@google.com Committed: https://github.com/dart-lang/sdk/commit/237313b0279c36e247f147e722d0c3f38e38f6fa

Patch Set 1 #

Patch Set 2 : Fix forgotten cleanup. #

Total comments: 8

Patch Set 3 : Rebase #

Patch Set 4 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+244 lines, -16 lines) Patch
M pkg/compiler/lib/src/commandline_options.dart View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/dart2js.dart View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/code_emitter_task.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/model.dart View 4 chunks +10 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart View 1 2 3 7 chunks +85 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart View 1 2 3 14 chunks +103 lines, -11 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/options.dart View 1 2 3 7 chunks +29 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (4 generated)
floitsch
Initial experiments were very promising. I would like to continue some tests with Greentea / ...
3 years, 7 months ago (2017-04-29 01:36:32 UTC) #3
sra1
LGTM I don't like having half-baked code in the compiler, so can you make it ...
3 years, 7 months ago (2017-05-02 20:40:13 UTC) #4
floitsch
PTAL. I didn't name everything to "experimental". When things were called "softDeferred" (or similar) I ...
3 years, 7 months ago (2017-05-06 19:25:44 UTC) #5
sra1
lgtm
3 years, 7 months ago (2017-05-09 17:31:02 UTC) #7
floitsch
3 years, 7 months ago (2017-05-09 18:33:36 UTC) #9
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
237313b0279c36e247f147e722d0c3f38e38f6fa (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698