Swift wasm binary sizes?

Personally, I wouldn’t find 500kB unacceptable at all. If I want to make a “hello world” example I’d just use JS. If I want to actually write some code, the overhead of 500kB would be insubstantial (don’t get me wrong: I’d prefer the overhead to be zero).

That said, a “hello world”-like example (after aggressive DCE using external tools) is currently 4.5MB with Swift Wasm, not 0.5MB. I’m still curious to know what can be done to reduce this.

Another thread recently referenced the Swift bug that unused public symbols will currently never be stripped. Fixing that seems like a big potential win, especially for statically linked binaries. Maybe that would also be enough to solve the issues mentioned above with the Unicode tables?

Edit: How to disable implicit Foundation imports? - #63 by Joakim_Hassila1 here is the post that mentions the open issues with DCE

1 Like