2 ms·
I'm not writing an operating system.The point is you cant get these perfs with using regular javascript.ASM.js is not regular javascript,since it's a subset.
by camus2 12y ago
I'm not writing an operating system.The point is you cant get these perfs with using regular javascript.ASM.js is not regular javascript,since it's a subset.
- Ygg2 12y agoNo, but this operating system is the example of most performant, least resource hungry application I can think off. If you need performance you don't write C, you write assembly. Same with asm.js.
- pjc50 12y agoYou try to avoid writing in assembly unless you absolutely have to, because it's a big maintenance pain and unless all your assumptions are correct it may not be as fast as the compiler. It's not worth bothering with unless you're vectorising or want to use some other instructions that are not normally emitted (e.g. ARM add-with-saturation).
- Ygg2 12y agoYeah, but assembly generally isn't portable (x86 assembly is different than ARM assembly, etc.), that's what makes it biggest pain IIRC. Asm.js on the other hand, is portable and just that makes it way better than any regular assembly. Also it seems better looking than regular assembly (no registers as such, no jumps, etc.). It's a huge step back compared to plain JS, but it's not that impossible to write in.