Firefox does not seem to be faster using the asm.js profile, yet Chrome is

血红的双手。 提交于 2019-12-02 23:33:31

When you run code in Firefox, you can often see huge drop in speed for asm.js calls, which is most probably caused either by repeated compilation (which is visible in console) or by cost of js-to-asm calls. This hypothesis is further strenghtened by Luke Wagner, implementor of asm.js:

one performance fault that we already know trips up people trying to benchmark asm.js is that calling from non-asm.js into asm.js and vice versa is much slower than normal calls due to general-purpose enter/exit routines. We plan to fix this in the next few months but, in the meantime, for benchmarking purposes, try to keep the whole computation happening inside a single asm.js module, not calling in and out.

To see it for yourself - look at the fiddle: http://jsperf.com/asm-simple/10

  • Firefox 26: 22,600K ops/sec in asm-asm case vs 300(!) in asm-js case.
  • Chrome 28: 18K vs 13K
  • IE11: ~7.5K for all tests, no big difference observed, except for dead code ellimination, where it shines ;)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!