After benchmarking, the superfast hash function does impact performance

as it better spread data in the hash table.


SVN revision: 35412
This commit is contained in:
Cedric BAIL 2008-08-08 16:07:32 +00:00
parent 79fb88b08e
commit 44e3c73e19
1 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ eina_stringshare_add(const char *str)
if (!str) return NULL;
slen = strlen(str) + 1;
hash_num = eina_hash_djb2(str, slen) & 0x3FF;
hash_num = eina_hash_superfast(str, slen) & 0x3FF;
for (el = share->buckets[hash_num]; el; pel = el, el = el->next)
{
el_str = ((char *)el) + sizeof(Eina_Stringshare_Node);
@ -182,7 +182,7 @@ eina_stringshare_del(const char *str)
if (!str) return;
slen = strlen(str) + 1;
hash_num = eina_hash_djb2(str, slen) & 0x3FF;
hash_num = eina_hash_superfast(str, slen) & 0x3FF;
for (el = share->buckets[hash_num]; el; pel = el, el = el->next)
{
el_str = ((char *)el) + sizeof(Eina_Stringshare_Node);