3 ms·
I ran this in Chrome, Safari 7 and Firefox. Firefox was the slowest of them all by quite some margin. I guess asm.js specific code enables some drastic speedups
by Flow 13y ago
I ran this in Chrome, Safari 7 and Firefox. Firefox was the slowest of them all by quite some margin. I guess asm.js specific code enables some drastic speedups with less effort from the JIT's point of view. Too bad this code did not utilize asm.js.
- camus2 13y ago> Too bad this code did not utilize asm.js. The goal of asm.js is to efficiently compile C/C++ into JavaScript using Enscriptem,it's not meant to be written by hand.
- kaoD 13y agoI doubt the Scala to JavaScript transpiling is done by hand.
- bad_user 13y agoCompiling a high-level level like Scala to asm.js does not make sense, as asm.js is meant for lower level languages (e.g. C++), not managed languages, although it might be in the future ... http://asmjs.org/faq.html http://asmjs.org/faq.html
- lihaoyi 13y agoI totally transcribed it by hand. The transcribed sources (http://lihaoyi.github.io/workbench-example-app/raytracer-opt.js http://lihaoyi.github.io/workbench-example-app/raytracer-opt...) are completely readable
- cromwellian 13y agoScala is a garbage collected language like Java, not really a good target for asm.js.
- pjmlp 13y agoI fail to see why. It is only a matter how good the GC would be.
- cromwellian 13y agoI think it would be rather inefficient, that is, not very useful. What would be the gain? Languages like Java have shown that AOT compilation doesn't really benefit them very much over runtime JIT. C->asm.js makes a lot of sense, but I'm not sure it would be very much of a win for Java or Scala, especially non-math heavy apps.
- pjmlp 13y agoIt is just that I think it is mostly a matter of how much performance one would be able to get from it. Just thinking out loud. On the other hand, implementing a GC system on top of another one is probably not the best way to spend time.
- pjmlp 13y agoYou can make use of LLJS.