摘要: http://burtleburtle.net/bob/hash/doobs.html Bob优化它的第二版本hash, 速度提高了3倍,http://burtleburtle.net/bob/c/lookup3.c 下面我提取的一个变长key, 小端版本(intel机器) #include stdint.h /* defines uint32_t etc */ #include sys/param.h /* attempt to define endianness */ #ifdef linux # include endian.h /* attempt to define 阅读全文
posted @ 2010-12-22 17:22 napoleon_liu 阅读(2111) 评论(1) 推荐(0)
摘要: Bob 研究了很多哈希,并实现了自己的高效hash。 我测试一下了,5w多的数据,time33出现了6条重复,bobhash没有一条重复。不过time33的速度是比bobhash快的。 http://burtleburtle.net/bob/hash/doobs.html 源码 typedef unsigned int uint32_t; #define hashsize(n) ((uint32_t)1(n)) #define hashmask(n) (hashsize(n)-1) #define mix(a,b,c) \ { \ a -= b; a -= c; a ^= (c13 阅读全文
posted @ 2010-12-22 14:15 napoleon_liu 阅读(1265) 评论(0) 推荐(0)