Re: minisphere 1.2b1 (stable: 1.1.8)
Reply #544 –
So out of curiosity, I ran the loop tests I discovered hidden in the Sphere-SFML test game source with all three current engines. The results are attached as screenshots.
The cliffnotes version: Obviously SphereSFML won because Jurassic is awesome, however one thing shocked me: The huge divide between minisphere and Sphere 1.5. I'll get to that in a minute, though. Before I get started, my test rig is an AMD A10-6800K @ 4.1 GHz with 8GB RAM and running Windows 8.1 Pro x64.
As you can see in the screenshots, Sphere 1.5 averaged around 1300ms per test. The only ones that were under 1000ms were the two that increment twice per iteration. This pattern shows across all engines, though, so apparently the loop condition check is expensive?
SSFML 0.90: The best result by far was "For i++ in Step", which got 17.2ms(!). Makes sense, that's the common case for a for loop, so Jurassic optimizes for it. What's interesting, though, is that Jurassic falters when it hits the i += 1 tests. If you're JITting, then i += 1 should compile to the same machine code as an increment, right? But apparently it doesn't. Weird. Ignoring the outliers, SSFML averages ~50ms per test, and around 130ms if you include everything. Very impressive.
Now we get to minisphere (1.2b1). If this is any indication, Duktape is literally 3-4 times faster than SpiderMonkey 1.5. I knew it was a highly optimized engine, but this still blew me away. Here again, though, i += 1 is way slower than a postfix increment for no discernible reason. It's only a 100ms difference though, so not really an outlier. Average across all tests: ~385ms.
So the bottom line is, not only is minisphere leagues faster than Sphere 1.5, but it holds up well against a JITted engine as well. And from what I hear, the Duktape dev is working on even more performance improvements, so that gap should narrow even further in the future.