summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2014-06-14 10:08:38 +0000
committerXavier Roche <xroche@users.noreply.github.com>2014-06-14 10:08:38 +0000
commitb10df97dd0e8c4c8287e722e5807142ed7321206 (patch)
tree8bf1ce70775834b53e61f221cda370a655c1c450 /src
parent7a1e4b826522ee6a12928a813b31ccb41f247d43 (diff)
Remarks over MD5 vs. murmur hashing.
Diffstat (limited to 'src')
-rw-r--r--src/coucal.c10
-rw-r--r--src/coucal.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/coucal.c b/src/coucal.c
index 3d1bce2..6311872 100644
--- a/src/coucal.c
+++ b/src/coucal.c
@@ -34,11 +34,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "coucal.h"
-/* We use md5 as hashing function for its quality regarding diffusion and
- collisions. MD5 is slower than other hashing functions, but is known to be
- an excellent hashing function. FNV-1 is generally good enough for this
- purpose, too, but the performance gain is not sufficient to use it by
- default.
+/* We use murmur hashing by default, even if md5 can be a good candidate,
+ for its quality regarding diffusion and collisions.
+ MD5 is slower than other hashing functions, but is known to be an excellent
+ hashing function. FNV-1 is generally good enough for this purpose, too, but
+ the performance gain is not sufficient to use it by default.
On several benchmarks, both MD5 and FNV were quite good (0.45 cuckoo moved
on average for each new item inserted in the hashtable), but FNV-1 was more
diff --git a/src/coucal.h b/src/coucal.h
index 478ef05..237898d 100644
--- a/src/coucal.h
+++ b/src/coucal.h
@@ -34,7 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Implementation notes:
* Implementation is auto-rehashable, and uses cuckoo hashing of size 2**n
- * with a MD5 or FNV-1 hash function, with one additional auxiliary hash
+ * with a FNV-1 or MD5 hash function, with one additional auxiliary hash
* function.
* It also uses a small stash area to handle rare cases of collisions.
* Enumeration of all key/values is possible, deletion is also possible, but