@matheusbsbs / matheus-bagliano / commits / fc66d213f8
Fork 0

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: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Mar 12, 2006 at 20:32 UTC fc66d213f8b2f13b9ffd643f01de25ddc95e0972
1 file changed +8 -1
diffcore-delta.c
+8 -1
@@ -26,12 +26,19 @@
26
27 /* Wild guess at the initial hash size */
28 #define INITIAL_HASH_SIZE 9
29 -#define HASHBASE 65537 /* next_prime(2^16) */
29 +
30 /* We leave more room in smaller hash but do not let it
31 * grow to have unused hole too much.
32 */
33 #define INITIAL_FREE(sz_log2) ((1<<(sz_log2))*(sz_log2-3)/(sz_log2))
34
35 +/* A prime rather carefully chosen between 2^16..2^17, so that
36 + * HASHBASE < INITIAL_FREE(17). We want to keep the maximum hashtable
37 + * size under the current 2<<17 maximum, which can hold this many
38 + * different values before overflowing to hashtable of size 2<<18.
39 + */
40 +#define HASHBASE 107927
41 +
42 struct spanhash {
43 unsigned long hashval;
44 unsigned long cnt;