Open
Description
Currently it seems that dart2wasm (a relatively simple compiler), uses 80% more memory than binaryen
When compiling flute specifically:
- dart2wasm uses 600 MB
- binaryen uses 330 MB
There's several reasons for this
- the AST is large
- the AST uses growable arrays instead of fixed-length arrays in nodes (in particular
FunctionNode
,FunctionType
,Arguments
) - the AST seems to include the source code as bytes
- the dart2wasm code generator keeps the IL instruction objects around for all functions until the very end
We could consider investigating if there's some low hanging fruits.