lua-users home
lua-l archive

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


> I had test the two hashint macro. and when insert 10000000 keys, the new macro cost about 2.7s, while old macro cost about 4s.
> 
> this is indeed faster.
> 
> 
> 
> and I also test the three hashint macro by use auto increase int key. this is the test lua code:
> 
> [...]

Many thanks for the feedback.

The new macro is obviously faster, but it is also more sensitive to
bad patterns (e.g., «for i = 1, 1e5 do a[(i << 32) | i] = i end»).
If we want a good hash, it may be worth paying the price of a full
64-bit modulo.

-- Roberto