|
----- Original Message ----- From: Roberto Ierusalimschy Date: 8/3/2010 6:58 AM
In Lua 4.0.1, lua_ref()/lua_getref()/lua_unref() are all written around a very fast C-based architecture for handling the refs. In Lua 5, this was generalized into actual Lua data structures, and there was a performance hit for doing so. In Lua 5.2, some additional slowdown has occurred, part of which is an even slower string based look up.An implementation of Lua 4-style refs is available in patch form below. I refer to them as fastrefs.What is "Lua 4-style refs"?
I refer to Lua 4-style refs (or fastrefs, as I called them in the original email) as being a movement of the implementation from Lua 4 into Lua 5. I have made some additional minor updates to it, but the fastref implementation is largely derived from Lua 4.
This is the first I've really looked at Lua 5.2. Are there any thoughts as to why the performance loss is so large?No. Are both versions compiled with the same options and compiler version?
Yes. The same options and compiler version were used for the benchmark.I'll have to trace code to see what might be going on. Perhaps the garbage collector is kicking in and skewing the results further.
Josh