Description
We should reduce AOT compilation time as it begins hitting certain limit on an internal large app (b/158101962). There are multiple things we can do:
-
The vast majority of compilation time is spent in TFA. So we can investigate if we can do the analysis more efficiently.
-
The app uses protobuf tree shaker and repeats TFA after applying protobuf tree shaker, which means TFA is performed 2 times. We can integrate protobuf-aware tree shaker with TFA more closely and avoid the 2nd round of TFA: Consider integrating protobuf-aware treeshaking in TFA directly instead of running two rounds of TFA #40785
-
We can split compilation into multiple steps, serializing state after each step and resuming from the serialized state. This will allow us to reduce time spent on each step and avoid hitting the limit.
https://dart-review.googlesource.com/c/sdk/+/150272 added--from-dill
option which allows to split front-end part of the compilation into a separate step.