4 ms·
How do you reduce javascripts cpu use below something like c/c++? Before you go off on "lock in", note that native apps have a distinct advantage over any web
by mitchty 10y ago
How do you reduce javascripts cpu use below something like c/c++?
Before you go off on "lock in", note that native apps have a distinct advantage over any web app using javascript. I hate having 20% cpu use for a stupid chat app on a modern i7 system. Most of that "app" is spinning around chasing its own tail making the cpu fetch memory incessantly and blow through cpu cache/tlb. I don't see that happening with native apps nearly as bad.
- amelius 10y agoWe have ASM.js/WASM, and it is pretty mature. If these platform owners really wanted to make it work, they had done so by now.
- mitchty 10y agoExcellent, are there any comparisons for the amount of energy used between that and a more native program? With comparisons for things like impact to cpu cache and memory? Just throwing out a technology doesn't invalidate my point that javascript likely has a lower bound on energy and cpu/cache impact.
- wrl 10y agoWASM isn't even ready for day-to-day use yet, and while ASM.js is mature, V8 has no special optimisations for it. Furthermore, you're still running the code on the Javascript VM/interpreter, so it's unlikely to give much of a speed boost. The motivation behind WASM and ASM.js both is to cross-compile code from other non-JS languages (generally, C/C++) into code usable from JS.