Skip to content

Using std::cout increases .wasm size by 900kb #87

@DanielHoffmann

Description

@DanielHoffmann

A simple C++ program I wrote was ~40kb, but adding a simple std::cout << "Hello World" increased the bundle size to ~950kb (using -O2, -Os doesn't affect the size much). Using stdio.h printf() doesn't meaningfully change .wasm file size

Not sure if there is a bug in the sdk or there is just a lot of logic inside std::cout that I am not aware of. In any case it can be extremely hard to track down the final .wasm size to the features used, it might be something this project could help track with an external tool somehow (linker flag to add some special tokens to the .wasm file?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions