I doubt that it would make any difference in size to use asm.js or not. 

WebAssembly is a bit smaller (about 10% when measuring the compressed size, 
which is the only number that matters, asm.js is much less dense, but also 
compresses much better than WASM).

I got an emscripten "hello world" down to 16 KByte compressed without 
"hacks", and a minimal WebGL demo to about 33 KByte. These numbers are for 
plain C code, C++ is a bit trickier.

Everything on top of those about 10..50 KByte overhead caused by the C or 
C++ runtime lib and emscripten JS wrapper depends on how "bloated" your 
C/C++ code is. 

Using a lot of dynamic dispatch calls (virtual methods or jump tables) 
makes it hard for the compiler to remove unused code, using C++ iostream 
adds a lot of size overhead (about 100 KByte), using alot of complex 
template code will also add a lot of size, etc etc...

I wrote a blog post about the topic a while ago: 
http://floooh.github.io/2016/08/27/asmjs-diet.html

The TL;DR is: emscripten-generated code can be small if you're very careful 
what code you feed it, you basically need to embrace embedded-style 
programming, since embedded programming is these days about the only 
programming style which cares about avoiding code bloat.

Cheers,
-Floh.

Am Mittwoch, 18. Oktober 2017 05:58:31 UTC schrieb caiiiycuk:
>
> Hi. Beacuse of google-chrome bug, and some other reasons I can't use 
> asm.js in my scripts. Currently I just replace "use asm"; to ""; For my 
> case is very important to reduce js size as much as possible. If I revert 
> all asm.js stuff (type declarations and etc.) to plain js, how do you think 
> how much size I can reduce?
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to