5 ms·
Can be. Based on those particular benchmarks, LuaJIT is even better than V8, and I've frequently run into situations where doing math in C++ is 5-10x faster tha
by TillE 11y ago
Can be. Based on those particular benchmarks, LuaJIT is even better than V8, and I've frequently run into situations where doing math in C++ is 5-10x faster than in LuaJIT.
I suspect the lack of an integer primitive is a big deal in both Lua and JavaScript.
- pcwalton 11y ago> I suspect the lack of an integer primitive is a big deal in both Lua and JavaScript. Not as much as you'd think. All JavaScript JITs speculate that numbers that have been observed to be integers remain integers and compiles them to use integer operations. As long as your code is hot enough to enter the optimizing JIT, the overhead is solely in whatever overflow checks couldn't be optimized out.
- chrisseaton 11y agoRight - just because you don't see integer primitives when you're programming doesn't mean they aren't there.