lua-users home
lua-l archive

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

On Sunday 12 October 2008, Canute Bigler wrote:
> My largest concern across the board is that of speed and not size.  For

if you have a C function that gets you the desired value from the 'name', try 
simply changing the Lua interface to receive the name and not the number.

Even better, make it work with both: if you get a string, call the convertion 
function. if it's a number, go ahead. if it's anything else, signal an error.

but if you need speed for each access (and not only short startup times), it 
would be hard to beat the hashtable.  in that case, try a memoizing table, so 
you can start with an empty table and build it as needed.  of course, this 
would only help if you're likely to repeat queries.


Attachment: signature.asc
Description: This is a digitally signed message part.