lua-users home
lua-l archive

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

On 1 Feb 2008, at 22:22, Mike Pall wrote:

If, on the other hand:

a) the loop you mention is re-written in Lua,
b) the variable r is a table, and
c) r.a is a plain table field lookup.

... then the compiler could probably optimize most of the
overhead away.

Yes, I figured that would be more effective. Well, I can't alter b) and c), but I *could* switch to a Lua loop. Will report back once I know more.

Rules of thumb: write all of it in Lua, use Lua tables
exclusively for data structures, avoid frequent upcalls from C to
Lua, avoid calling "black-box" C functions in tight loops.

Interesting. Thanks,