]> git.sesse.net Git - remoteglot-book/blob - hash.h
Set parallel merges to a value different from parallel loads.
[remoteglot-book] / hash.h
1 #ifndef _HASH_H
2 #define _HASH_H 1
3
4 // Hashing more or fewer bytes is a tradeoff between more even partitions
5 // and total size (since seemingly key/prefix compression works better with
6 // smaller values). This value seems to be very close to optimal wrt. size,
7 // and has imbalances smaller than 2:1.
8 #define HASH_PREFIX_BYTES 4
9
10 int hash_key_to_bucket(const char* s, size_t len, int num_buckets);
11
12 #endif  // !defined(_HASH_H)