Yes, on synthetic benchmarks for LuaJIT-2.0.0-beta10 and PyPy 1.9. Those numbers need updating for the latest versions, but the basics are as follows. LuaJIT is incredibly fast to warm-up. On short benchmarks (around a second or less), it is way ahead of PyPy. As code runs for longer and longer, PyPy tends to catch up, and sometimes overtake, LuaJIT.
My experience of RPython and PyPy suggests that there is a fair bit of scope for reducing some of the warm-up cost. I don't think PyPy will ever match LuaJIT's warm-up time, but it may well move quite a bit closer over time. It'll be interesting to see.
Are you sure PyPy can overtake LuaJit after warmup. I think it can maybe do it in a micro benchmark but I doute that in a complex benchmark PyPy has any chance.
LuaJit uses more advanced elimnation of loads and other optimications, also Lua is easier to optimize in generall.
I dont know the numbers but I would really be astunished if that was true.
To me, the real deciding factor that tells me that LuaJIT will win in the long run is that LuaJIT traces the high-level semantics of Lua, whereas PyPy has to work with Python bytecode, which may have a considerable amount of lost information. There are some good examples in the lambda-the-ultimate thread (for example, optimizing based on the knowledge that HLOAD and ASTORE will never alias).
PyPy can't feasibly optimize the high-level Python AST, because the language is very large compared to Lua, and more or less behaviorally defined by Python's bytecode compiler.
This is one of the interesting things about LuaJIT: it demonstrates the value of a small, well-designed language in a shockingly awesome way. The care that the Lua designers put into making Lua simple and regular is one of the reasons why a single programmer (a demigod, yes, but still — one demigod) is able to make so impressive an implementation.
> Are you sure PyPy can overtake LuaJit after warmup. I think it can maybe do it in a micro
> benchmark but I doute that in a complex benchmark PyPy has any chance.
When comparing the performance of different languages, micro benchmarks are about all we have, for better or worse. The best we can do is to run a fair number of different such benchmarks and make the comparison over them. I made my statement on the basis of such a comparison.
Both LuaJIT and RPython / PyPy are very clever systems and there's a surprising amount of overlap between the way they do things. But every system has its own strengths and weaknesses, and it doesn't surprise me personally that neither one is a winner 100% of the time.
My experience of RPython and PyPy suggests that there is a fair bit of scope for reducing some of the warm-up cost. I don't think PyPy will ever match LuaJIT's warm-up time, but it may well move quite a bit closer over time. It'll be interesting to see.