3 ms·
> but you can't beat native code in tight loops But you can. https://bugzilla.mozilla.org/show_bug.cgi?id=618692#c1 https://bugzilla.mozilla.org/show_bug.cgi?
by bzbarsky 15y ago
> but you can't beat native code in tight loops
But you can. https://bugzilla.mozilla.org/show_bug.cgi?id=618692#c1 https://bugzilla.mozilla.org/show_bug.cgi?id=618692#c1 has a simple example where Java beats gcc -O3 by a factor of 1.5 or so on exactly such a loop. This is not an isolated case, and I fully expect JS JITs to get there for many situations. Unless browsers stop improving them, of course.