Why does asm.js deteriorate performance?

前端 未结 2 938
旧巷少年郎
旧巷少年郎 2021-01-31 02:41

Just to see how it performs, I wrote a very short asm.js module by hand, which simulates the 2D wave equation using 32-bit integer math and typed arrays (Int32Array). I have thr

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 03:22

    There is some fix cost to switching asm.js contexts. Ideally you do it once and run all of your code within your app as asm.js. Then you can control memory management using typed arrays and avoid lots of garbage collections. I'd suggest to rewrite the profiler and measure asm.js within asm.js - without context switching.

提交回复
热议问题