Open mraleph opened 4 years ago
/cc @mkustermann
FWIW dart2js does a limited amount of eager initialization, with syntactic recognition of effect-free initializers (it won't detect this example). https://dart-review.googlesource.com/c/sdk/+/94749
@rakudrama we also have some limited support (essentially limited to literal initializers right now) - but it would be good to expand it.
For example in our core libraries:
We could theoretically include
Int8List
into the snapshot instead of including code to build it - which would be much larger.We could probably start by collecting some statistics of how initializers in typical Flutter applications look like.
This might have additional benefit of improving performance by removing
InitStaticField
in AOT.