bigcache icon indicating copy to clipboard operation
bigcache copied to clipboard

how about higher quality hash algorithm?

Open chen-zhuohan opened this issue 3 years ago • 1 comments

Although hash algorithm is not the Bottleneck of bigcache, the smhasher(the project of hash function quality and speed tests) show that FVNa has poor quality while other hash func has higher.

Should we evaluate the default hash func of bigcache again? After the question and answer of hash, lots of new hash functions come out, such as xxhash, wyhash, menhash, which have higher quality.

Due to some hash functions use hardware instructions provided by the CPU to accelerate (AVX2, SSE), we can use different hash func in different Platform, such as:

  1. FVNa default
  2. xxhash in amd

By the way, why bigcache has no dependence? Should only no dependence PR can be approve?

Look forward to your reply!

chen-zhuohan avatar Jun 29 '22 06:06 chen-zhuohan

By the way, why bigcache has no dependence? Should only no dependence PR can be approve?

Making golang the only dependency makes this lib easy to use and update. I think we should keep it that way.

We have Hasher interface introduced in https://github.com/allegro/bigcache/pull/5 to enable users using their own hash method. I think it will be great if you can create hasher implementation with benchmarks on different datasets and machines. We can link to it from readme so if anybody need it they are free to add dependency.

janisz avatar Jul 21 '22 14:07 janisz