Skip to content

Commit 05ca809

Browse files
committed
Make hash table algorithm selectable
jenkins hash is old. Lets try murmur3 to start! Default is the old one, so people aren't surprised.
1 parent d5d4c49 commit 05ca809

16 files changed

+659
-452
lines changed

Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ timedrun_SOURCES = timedrun.c
1010

1111
memcached_SOURCES = memcached.c memcached.h \
1212
hash.c hash.h \
13+
jenkins_hash.c jenkins_hash.h \
14+
murmur3_hash.c murmur3_hash.h \
1315
slabs.c slabs.h \
1416
items.c items.h \
1517
assoc.c assoc.h \

assoc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static void *assoc_maintenance_thread(void *arg) {
218218
for (it = old_hashtable[expand_bucket]; NULL != it; it = next) {
219219
next = it->h_next;
220220

221-
bucket = hash(ITEM_key(it), it->nkey, 0) & hashmask(hashpower);
221+
bucket = hash(ITEM_key(it), it->nkey) & hashmask(hashpower);
222222
it->h_next = primary_hashtable[bucket];
223223
primary_hashtable[bucket] = it;
224224
}

doc/protocol.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ other stats command.
559559
| hashpower_init | 32 | Starting size multiplier for hash table |
560560
| slab_reassign | bool | Whether slab page reassignment is allowed |
561561
| slab_automove | bool | Whether slab page automover is enabled |
562+
| hash_algorithm | char | Hash table algorithm in use |
562563
|-------------------+----------+----------------------------------------------|
563564

564565

0 commit comments

Comments
 (0)