lua-users home
lua-l archive

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


> How are
> table lookups implemented in lua.I was thinking wether it would be
> (significantly)faster to store the info about cvars in an internal C
> hash table for the lookups.Would there be any difference?

Lua uses chained hash tables where hash values that are in their right spot
take precedence over "misplaced" hash vales (and will relocate those if
necessary.)  Moreover, space usage has been neatly implemented (grow if 3/4
full, shrink if less than 1/4 full.)  All in all,  Lua tables are pretty