Chromium Code Reviews
DescriptionJS 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)
|