How much does the Wasm backend improve the size of...
# webassembly
t
How much does the Wasm backend improve the size of the generated code compared to the JS IR backend?
s
We haven't integrated dead code elimination to K/Wasm yet. Code size measurements are not very useful until then.
t
Ah, I see. But it's expected to generate smaller code than Kotlin/JS once DCE is implemented, right?
s
I would expect higher constant overhead because in K/JS we use built-in library for things like math, strings and arrays. But overhead multiplier for user defined code should be lower because of compact byte-code. To sum it up - smaller size for large projects and bigger size for tiny projects.
👍 1
t
Interesting. I noticed that the size of generated code with Kotlin/JS seemed to grow quite quickly as the project grew, so maybe the project doesn't have to be all that big to benefit. Thanks.
s
These is just my intuition. We'll have to measure and see.
I would also expect Wasm code to start running faster after it is downloaded, compared to the same size JS.
t
Also can get the benefits of parallelism right