lua-users home
lua-l archive

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


On Friday 18 August 2006 3:09 pm, Mike Pall wrote:
> BTW: Another one for the wishlist: lua_cleartable(L, narr, nrec).
> Use case: a common table referenced in dozens of upvalues needs
> to be cleared fast. Replacing it with a new table is not an
> option because then I'd have to store all affected closures
> somewhere. Iterative clearing is annoying/slow. Don't know if
> this is a popular wish, though.

i'd like to do that from Lua code.  when optimising the inner loops in 
Xavante, i found that eliminating even a single table creation made a 
perceptible difference.  unfortunately, there are very few structures that 
should persist from one request to the next, so it still has to create 
several new tables before servicing the request.  clearing them instead of 
recreating should be faster.

but, it's just an optimisation detail.  not critical, and definitely not 
reason enough in itself.

-- 
Javier

Attachment: pgp_aACGdCr9t.pgp
Description: PGP signature