Hacker News new | past | comments | ask | show | jobs | submit login

The main problem is that Mandreel is closed source. I don't have access to it, so I can't just compile two C++ benchmarks and compare the results.

However, I suspect the Emscripten version is faster, for a few reasons:

* Indirect measurements on Box2D in that link indicate Emscripten is faster.

* Looking at the generated code shows several things Emscripten does better, for example it uses the native JS stack for function calls (Mandreel pushes all the arguments onto the emulated C stack which is additional work), the Emscripten relooper implementation is more optimized, etc.

* Emscripten uses closure compiler to minify and further optimize the generated code while Mandreel does not. This mainly affects download size, but not only - closure can do optimizations at the JS level that can't be done before, like for example inlining handwritten glue code in JS into compiled JS code.

* Mandreel used to use an older version of LLVM and Clang than Emscripten, which always uses the latest, and there have been big 'free' speedups in Emscripten due to improvements in the LLVM optimizer. (But, perhaps Mandreel has updated, without access to it I don't know.)

* Emscripten has gotten a lot of issues filed about performance issues, pull requests, etc. as a benefit of being open source, which led to plenty of improvements. I can't be sure but I am guessing there are fewer people that bought a Mandreel license and contributed feedback.

Note though that the question of which is fastest is a little problematic - one compiler's output might be faster in one browser but slower in another, so there isn't an objective sense of "fastest" here. But with that said, there are aspects of the code that should be faster in all browsers, like as mentioned above the more optimized way that Emscripten does function calls.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: