lua-users home
lua-l archive

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


Hi the list,

Sorry to raise this overly discussed topic again, but I'd
believe there has to be some real solution to embed lua in a
real-time environment, I mean, eventually.

We are using Lua extensively in building our game, including
the main loop, the entire GUI, and almost everything is written
in Lua. As the code explodes, we are finding that sometimes
lua's GC takes 2 seconds! So we change to force the GC every 4
seconds, which results in a GC time around 60ms to 130ms, which
is tolerable, but I wouldn't say satisfactory.

So my question is, is there anybody currently working on a
incremental GC patch or something? Just in case somebody is
already working on it, I don't want to reinvent the wheel :)

Otherwise, I'd like to make a proposal to accelerate the
progress. The good news is, a guy in our team has internally
coded a GC library that does incremental mark-and-sweep, and we
don't mind opening our code; the bad news is, the library is
freshly made from scratch with no much similarity to Lua's
internal, so expect a lot of work to be done.

The solution I have in mind is either

    1) to wrap of Lua's bytecode core around our GC lib
       and maintain bytecode compatibility;
or
    2) using our GC lib as a reference implementation to
       adapt Lua's current GC code to a incremental one;

Unfortunately, solution 1) is going to cause a fork in Lua,
which is something probably nobody wants to see.

Our team is currently pretty tied up, and we aren't in the
position to volunteer as a lead of this project. I am seeking
any opinions or suggestions on this issue, and of course, Lua's
author is best to comment on this.

Regards,
.paul.