[dart2wasm] Implement inlining functions with function expressions in the body #55027
Labels
area-dart2wasm
Issues for the dart2wasm compiler.
type-performance
Issue relates to performance or code size
Consider this function from the protobuf library:
Assuming wasm-opt can inline and eliminate dart2wasm closures with just one call site, inlining this can potentially yield performance improvements, as it would eliminate tear-off allocations in the call sites.
Doing the same transformation manually yielded great improvements: google/protobuf.dart#911.
However we currently can't do this, because function expressions currently prevent inlining:
sdk/pkg/dart2wasm/lib/translator.dart
Line 954 in 94e653f
We should remove this restriction and allow inlining functions with function expressions.
The text was updated successfully, but these errors were encountered: