lua-users home
lua-l archive

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

GrayFace wrote:
> Well, what I've seen doesn't look so crappy.

Uh? I guess we've not been looking at the same code. It raises all
alarm signals for bad Lua code I could think of.

E.g. the code uses 380 (!) global accesses in 1077 lines. This is
just the static count and it's already unbelievably bad.

And that's just the tip of the iceberg: loops where you don't need
them; useless abstractions piled on top of other abstractions. Ick.
This code is _NOT_ representative for a well-written Lua program
nor for a well-written raytracer.

FYI: Geoff Leyland has ported a minimal C++ raytracer and it takes
only 130 lines in Lua. I'm using it for my benchmarks and it's
quite competitive. Maybe he wants to post it for reference.

> I also
> thought LuaJIT somehow magically makes globals access as fast as
> access to upvalues :)

The use or better the non-use of globals is a question of
programming style.