lua-users home
lua-l archive

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


Hello,
I was looking at the lua source in order to understand how it handles
hashing, specifically collisions.  At the top of ltable.c there is a comment
explaining that the loading does not adversely effect performance.  After
digging around the code for a while, I'm still not sure I understand how lua
implements hash tables and handles collisions :-)  Can anybody help me to
understand the implementation?

Specifically, we implemented our own hashing algorithm internally in our
game engine to resolve the compound scene/object ids and we took advantage
of the fact that the ids are generated sequentially giving an even
distribution.  I'm now looking at lua to understand how our table names, all
with long strings with sequential end characters might cause problems for
lua's hashing.  E.g. does table name have any impact at all on hashing in
lua?

Thanks,
Brett