6 ms·
It really depends on what you mean by "slower". Emscripten already supports the "Emterpreter"[1], which uses a straight bytecode (not AST, like webassembly) ver
by magicalist 11y ago
It really depends on what you mean by "slower". Emscripten already supports the "Emterpreter"[1], which uses a straight bytecode (not AST, like webassembly) version of your asm.js code that can be downloaded and parsed quickly while the much more verbose asm.js code is still downloading and being parsed. So while it does more work, it's responsive sooner.
If fast start up time is the top priority for your app, the polyfill could easily be the best choice (and there are probably more tricks to be done with incremental parsing by feeding the JS engine wasm -> asm.js code in chunks while running an interpreter in the meantime, prioritizing hot functions in the wasm stream).
[1] https://blog.mozilla.org/research/2015/02/23/the-emterpreter-run-code-before-it-can-be-parsed/ https://blog.mozilla.org/research/2015/02/23/the-emterpreter...