lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, 2011-02-13 at 12:24 +0100, Mike Pall wrote:
> Alexander Gladysh wrote:
> > I'm not making any conclusions from that — I did not look on the code,
> > so please don't get angry. :-)
> 
> Well, I did. It's probably the crappiest Lua code I've seen in a
> while. And the crappiest ray tracer, too.
> 
> I mean ... lots of globals, tons of trivial loops with an
> iteration count of three, branchy as hell, and so on. This thing
> spends more than 50% of its time in the garbage collector, too.
> I sincerely hope nobody writes Lua code like this.

Maybe we should dedicate a chapter to issues like these in Lua Cookbook
- what NOT to do when writing code that can should run efficiently with
LuaJIT. Simple recipes on how to rewrite inefficient pieces of code and
what to avoid, similar to "Lua Performance Tips" gem by Roberto
Ierusalimschy.