3 ms·
Isn't that what asm.js did?
by k__ 6y ago
Isn't that what asm.js did?
- brundolf 6y agoMaybe from a certain perspective. But it worked by conforming the bundle to a particular subset of JS that the authors knew to be optimized, instead of expressing information to the interpreter outright. That seems like a comparatively limited channel for communication.
- jacobolus 6y agoFrom what I understand, in Safari at least they tried to make many of the optimizations general. So if you use asm.js-style type indications in your code even without following the full spec, you might see some performance benefit. I have sometimes found a speedup when adding apparently an superfluous |0.
- pornel 6y agoThe highly optimizable, explicit and precise code for the interpreter is WASM. JS VMs don't need more hints from the code. They need guarantees. They already analyze and profile JS, but as long as JS is allowed to be dynamic (and it has to, it won't be JS without it), then they have to keep the complexity and cost of all the extra runtime checks and possible deoptimizations.