Last time, we looked at Emscripten's performance with current JS JITs on an in-order Atom core and found a penalty relative to out-of-order cores.

However, I told @js_dev I'd give updated numbers on a more typical out-of-order x86 core like my 2010 MacBook Pro's i5.

There are a couple interesting things here: Firefox 19 shows substantial Emscripten performance improvements over Firefox 17, which is even still on par with hand-written JavaScript. While JavaScript JITs are still an order of magnitude away from native code performance, Emscripten's performance meets or exceeds the performance of hand-written JavaScript. Progress!

The machine is a 2010 Macbook Pro, Core i5 2.53 GHz, OS X 10.6.

For each compiler, I compiled with -O0, -O1, -O2, -O3, and picked the best result.

LanguageCompilerVariantVertex RateSlowdown
C++clang -O2SSE1001421971
C++gcc -O3SSE931091801.08
C++gcc -O3scalar603983331.66
C++clang -O2scalar583243081.72
JavaScriptChrome 23untyped951048910.5
Emscripten -O3Aurora 19.0a2scalar766600013.1
Emscripten -O3Firefox 17scalar604400016.6
JavaScriptChrome 23typed arrays589000017
Emscripten -O3Chrome 25.0 canaryscalar573370617.5
JavaScriptFirefox 17untyped526473519
JavaScriptFirefox 17typed arrays524000019.1
Emscripten -O2Chrome 23scalar458616521.8
Emscripten -O1nodejs 0.8.10scalar445310922.5
Emscripten -O2nodejs 0.8.10scalar148340667.5
Emscripten -O3nodejs 0.8.10scalar668796150

Here are the results for various Emscripten optimization levels:

BrowserCompilation LevelVertex Rate
Firefox 17emscripten -O02451509
Firefox 17emscripten -O14080000
Firefox 17emscripten -O25146000
Firefox 17emscripten -O36044000
Chrome 23emscripten -O01229754
Chrome 23emscripten -O14152339
Chrome 23emscripten -O24586165
Chrome 23emscripten -O3465162
Aurora 19.0a2emscripten -O02062762
Aurora 19.0a2emscripten -O14900000
Aurora 19.0a2emscripten -O26214757
Aurora 19.0a2emscripten -O37666000
Chrome 25.0 canaryemscripten -O03001399
Chrome 25.0 canaryemscripten -O14410235
Chrome 25.0 canaryemscripten -O25482000
Chrome 25.0 canaryemscripten -O35733706

I updated the benchmark to automate compiling and running the native and node.js builds.