lua-users home
lua-l archive

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


Soni "They/Them" L. <fakedme@gmail.com> 于2019年5月7日周二 上午2:17写道:

>
> but your code seems to use a whole other table?

It cache the index in the Proto , not another table.  It suggest the
place of entry in a hash table when the VM execute bytecode at the
same place.


>
> Another idea would be, for short n (table hash length, 1 or 2 hash
> entries), it might be faster to do a linear scan of the whole hash table
> before trying to hash the key. But this has other issues.
>

If a table has only one hash entry, it must be in main position. I
don't think it can be faster.

-- 
http://blog.codingnow.com