D hash table comparison benchmark

Eugene Wissner belka at caraus.de
Tue Jun 26 14:33:25 UTC 2018


On Tuesday, 26 June 2018 at 09:03:10 UTC, Eugene Wissner wrote:
> It seems it doesn't work with a branch in dub.sdl. I just 
> replaced the files in ~/.dub/packages.

And to make tanya perform better than built-in AAs in the first 
test, define a hash function:

size_t hasher(int e)
{
     return e;
}

and then:

mixin(benchmarkCode!("tanya.container.hashtable", 
"Tanya_HashTable!(int,int, hasher)"));

or

mixin(benchmarkCodeReuse!("tanya.container.hashtable", 
"Tanya_HashTable!(int,int,hasher)"))

Tanya hashes any value, also integral types; other hashtables 
probably not. It should theoretically provide better key 
distribution.


More information about the Digitalmars-d mailing list