3 ms·
In my experiments I found that gzipped asm.js is in the same ballpark as gzipped 64-bit x86 code. asm.js might come out 10..20% bigger, but not more. The absolu
by flohofwoe 11y ago
In my experiments I found that gzipped asm.js is in the same ballpark as gzipped 64-bit x86 code. asm.js might come out 10..20% bigger, but not more. The absolutely important point is to make sure that the download is compressed (web servers typically do this for .js files).
There is a static size overhead of up to a few hundred kbytes for C/C++ runtime code which needs to be included in the asm.js file, and which normally lives in system dlls when running as native code, but this can be optimized by trying to minimize the use of C++ (e.g. iostreams introduce quite terrible bloat, better to just use printf). A lot of work has gone into emscripten to optimize the output size, also very recently (e.g. a linker pass which scans the code for duplicate functions and removes them, which sometimes helps for code which makes heavy use of templates).