Skip to content

Memory use of dart2wasm #60096

Open
Open
@mkustermann

Description

@mkustermann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart2wasmIssues for the dart2wasm compiler.type-performanceIssue relates to performance or code size

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions