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

Issue 8676041: JS tree shaking for incremental builds. (Closed)

Created:
9 years ago by mmendez
Modified:
9 years ago
Reviewers:
zundel, codefu, fabiomfv
CC:
reviews_dartlang.org, danrubel
Visibility:
Public.

Description

JS tree shaking for incremental builds. This patch does two things: 1) Introduces the infrastructure that is needed by dart-level tree shaking so that it can properly deal with native JS code and thereby prune both dart and JS code. 2) Leverages the infrastructure above to enable JS-level tree shaking of the output of incremental builds by default. Non-incremental builds are not impacted and neither are libraries without entry points. Prior to this patch an empty application compiled to 558,508 bytes, but with it the size is reduced to 103,679 bytes. It is important to note that the large lower bound is driven by the dependency chain introduced by isolate$processWorkerMessage in corelib/implementation/isolate.js. For applications like total the savings are much bigger. Prior to this patch Total compiled to 12,151,122 bytes, but with it the size is reduced to 3,758,174. For an app the size of total this additional tree shaking takes about 2 seconds. Once this patch lands the plan is to thread it into the pending dart-level tree shaking work if needed. This second arc of work will allow us to further compress the output during non-incremental builds by eliding RTT, native JS code, dart methods exposed to native JS code and do dead code elimination. Committed: https://code.google.com/p/dart/source/detail?r=2077

Patch Set 1 #

Total comments: 16

Patch Set 2 : Incorporate feedback from codefu, fabiomfv and zundel #

Patch Set 3 : Actually renamed nodesProcessed #

Patch Set 4 : Recovering from a JS parse failure requires a new input stream #

Patch Set 5 : DartCompilerWarmup doesn't write files ending in *.app.js* #

Messages

Total messages: 12 (0 generated)
mmendez
See CL description for full details.
9 years ago (2011-11-29 20:33:18 UTC) #1
zundel
http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java File compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java (right): http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java#newcode47 compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java:47: private OutputFileWriter(Set<AstNode> nodesProcessed, Writer outputFile, Reader inputFile) { maybe ...
9 years ago (2011-11-30 15:09:57 UTC) #2
codefu
Other than Eric's comments, lgtm. http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java File compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java (right): http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java#newcode64 compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java:64: nit; ws http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java File ...
9 years ago (2011-11-30 23:43:33 UTC) #3
fabiomfv
On 2011/11/30 23:43:33, codefu wrote: > Other than Eric's comments, lgtm. > > http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java > ...
9 years ago (2011-12-01 15:37:26 UTC) #4
fabiomfv
LGTM - minor comment. http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java File compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java (right): http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java#newcode178 compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java:178: outputFileSize = CharStreams.copy(artifactReader, artifactWriter); could ...
9 years ago (2011-12-01 15:37:40 UTC) #5
mmendez
PTAL. I believe that I have addressed everyone's feedback. Once this lands there are some ...
9 years ago (2011-12-01 21:31:30 UTC) #6
zundel
LGTM with nit http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java File compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java (right): http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java#newcode47 compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java:47: private OutputFileWriter(Set<AstNode> nodesProcessed, Writer outputFile, Reader ...
9 years ago (2011-12-02 12:33:43 UTC) #7
codefu
LGTM On 2011/12/01 21:31:30, mmendez wrote: > PTAL. I believe that I have addressed everyone's ...
9 years ago (2011-12-02 13:26:06 UTC) #8
mmendez
I updated the patch with Eric's suggested rename. http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java File compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java (right): http://codereview.chromium.org/8676041/diff/1/compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java#newcode47 compiler/java/com/google/dart/compiler/backend/js/analysis/TreeShaker.java:47: private ...
9 years ago (2011-12-02 13:26:52 UTC) #9
fabiomfv
On 2011/12/01 21:31:30, mmendez wrote: > PTAL. I believe that I have addressed everyone's feedback. ...
9 years ago (2011-12-02 14:25:17 UTC) #10
zundel
still LGTM
9 years ago (2011-12-05 14:13:23 UTC) #11
codefu
9 years ago (2011-12-05 16:05:27 UTC) #12
On 2011/12/05 14:13:23, zundel wrote:
> still LGTM

3 for 3, LGTM (still)

Powered by Google App Engine
This is Rietveld 408576698