Commit fc66d213 authored by Junio C Hamano's avatar Junio C Hamano

diffcore-delta: tweak hashbase value.

This tweaks the maximum hashvalue we use to hash the string into
without making the maximum size of the hashtable can grow from
the current limit.  With this, the renames detected becomes a
bit more precise without incurring additional paging cost.
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 2821104d
......@@ -26,12 +26,19 @@
/* Wild guess at the initial hash size */
#define HASHBASE 65537 /* next_prime(2^16) */
/* We leave more room in smaller hash but do not let it
* grow to have unused hole too much.
#define INITIAL_FREE(sz_log2) ((1<<(sz_log2))*(sz_log2-3)/(sz_log2))
/* A prime rather carefully chosen between 2^16..2^17, so that
* HASHBASE < INITIAL_FREE(17). We want to keep the maximum hashtable
* size under the current 2<<17 maximum, which can hold this many
* different values before overflowing to hashtable of size 2<<18.
#define HASHBASE 107927
struct spanhash {
unsigned long hashval;
unsigned long cnt;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment