On 06/04/2012 06:44 AM, Mike Pall wrote:
I wish there were a guide on how to write scripts to get the best performance from Lua using LuaJIT. Hopefully someone can add a good one to the wiki.The real problem is that the code and data structures used are suboptimal. Mostly because it's way too branchy and the recursion is not deep enough to generate useful traces.
You say that, but removing it makes execution take almost twice as long on my computer (from 1.77s to 3.0s). I guess it's probably this heuristic problem. :\And that rowminus stuff actually hurts performance.
Basically, the JIT compiler gives up at a certain point, which depends on the heuristics. The timing you get depends on when and where that happens (see -jv).
Is there a guide anywhere on how to interpret/use the output of -jv? - Avi