Open sophiajt opened 4 years ago
This means that if you're using instantiateStreaming the second the Web request is done the WebAssembly module is probably ready to go.
That sounds interesting - faster load time without optimizing the file itself.
This means that if you're using instantiateStreaming the second the Web request is done the WebAssembly module is probably ready to go.
That sounds interesting - faster load time without optimizing the file itself.
Now that I've looked around: As far as I can tell, webpack already makes use of that: https://github.com/webpack/webpack/pull/7144/files
Otherwise, they mention setting opt-level = 's'
, which we already have in place. I justed tested adding lto = true
- that increased the size of pkg/wasm_nu_bg.wasm by about 9kb.
Actually profiling the size might yield more insight what can be optimized, but that's too far outside my zone: https://rustwasm.github.io/book/reference/code-size.html#the-twiggy-code-size-profiler
Looks like there are some tips here: https://rustwasm.github.io/book/reference/code-size.html
For how we might be able to optimize the code size of the wasm we transmit.