Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM files are quite large? #5559

Open
KevinVitale opened this issue Nov 3, 2023 · 2 comments
Open

WASM files are quite large? #5559

KevinVitale opened this issue Nov 3, 2023 · 2 comments

Comments

@KevinVitale
Copy link

KevinVitale commented Nov 3, 2023

Description

Long-time Swift dev here, dipping into this WASM project for the first time. This Swift file prints "Hello, WASM":

> main.swift:
print("Hello, WASM!")

The file generated is 6MB+:

$ ls -al main.wasm
$ 6.35M 03.Nov'23 13:50  main.wasm

Questions

  • Is this typical of WASM files? Or something more specific to the details of this project?
  • How can I reduce the file size? An ancillary task I'm working on limits WASM files to 128k.
@kateinoigakukun
Copy link
Member

Unfortunately it's a typical size of wasm binary produced from Swift today. There are several known inefficiencies in the toolchain due and we are hardly working on improving it. You might be able to find some useful resources in #7

@esummers
Copy link

The upcoming Embedded Swift features will allow much of the overhead (reflection, unused code, etc.) to be stripped out of WASM builds, but that is still in early development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants