Skip to content

v2.1-20201001

The new hashing scheme in luajit is more sophisticated, with two
different hashing functions and a proper multilevel hash to account
for collisions.  The sparse hash function is expected to be fast and
the dense hash function is expected to be slower.  Accommodate the
CRC32 based hash implementation accordingly by splitting it into fast
and slow functions.

The hash_sparse crc32 implementation avoids using the slow 128 and
above path so that it can complement the speed requirements.  Based on
the benchmark it takes about 20% less time to compute hashes compared
to the upstream hash_sparse.  It regresses in the 64-128 byte range
and then again gains performance in the 128 byte and larger range.

The hash_dense implementation is consistently faster than the stock
hash_dense implementation, which scales linearly.  The standard
deviation reported by the tests are comparable for both sparse and
dense implementations.
Assets 2
Loading