Permalink
Browse files

Make hash table algorithm selectable

jenkins hash is old. Lets try murmur3 to start! Default is the old one, so
people aren't surprised.
  • Loading branch information...
1 parent d5d4c49 commit 05ca809cc4bda62f0c778be29bfdf565fa39142d @dormando dormando committed Apr 17, 2014
Showing with 659 additions and 452 deletions.
  1. +2 −0 Makefile.am
  2. +1 −1 assoc.c
  3. +1 −0 doc/protocol.txt
  4. +18 −428 hash.c
  5. +6 −7 hash.h
  6. +2 −2 items.c
  7. +431 −0 jenkins_hash.c
  8. +15 −0 jenkins_hash.h
  9. +26 −1 memcached.c
  10. +1 −0 memcached.h
  11. +124 −0 murmur3_hash.c
  12. +19 −0 murmur3_hash.h
  13. +1 −1 slabs.c
  14. +3 −3 stats.c
  15. +1 −1 t/binary.t
  16. +8 −8 thread.c
View
@@ -10,6 +10,8 @@ timedrun_SOURCES = timedrun.c
memcached_SOURCES = memcached.c memcached.h \
hash.c hash.h \
+ jenkins_hash.c jenkins_hash.h \
+ murmur3_hash.c murmur3_hash.h \
slabs.c slabs.h \
items.c items.h \
assoc.c assoc.h \
View
@@ -218,7 +218,7 @@ static void *assoc_maintenance_thread(void *arg) {
for (it = old_hashtable[expand_bucket]; NULL != it; it = next) {
next = it->h_next;
- bucket = hash(ITEM_key(it), it->nkey, 0) & hashmask(hashpower);
+ bucket = hash(ITEM_key(it), it->nkey) & hashmask(hashpower);
it->h_next = primary_hashtable[bucket];
primary_hashtable[bucket] = it;
}
View
@@ -559,6 +559,7 @@ other stats command.
| hashpower_init | 32 | Starting size multiplier for hash table |
| slab_reassign | bool | Whether slab page reassignment is allowed |
| slab_automove | bool | Whether slab page automover is enabled |
+| hash_algorithm | char | Hash table algorithm in use |
|-------------------+----------+----------------------------------------------|
Oops, something went wrong.

0 comments on commit 05ca809

Please sign in to comment.