ktprime / emhash

Fast and memory efficient c++ flat hash map/set
MIT License
435 stars 30 forks source link

Which HashSet is fastest? #26

Closed qdztxc closed 1 year ago

qdztxc commented 1 year ago

This is no doc mentioned about HashSet. What's the difference between hash_set2 hash_set3 hash_set4 and hash_set8? Which is the fastest?

Besides Is there a mapping relationship between HashMap and HashSet?

ktprime commented 1 year ago

run the benchmark code on your evn( compiles on emhash/bench dir) https://github.com/ktprime/emhash/blob/master/bench/sbench.cpp

/mnt/d/emhash-master/bench$ make BF=1 SW=1 std=17 /mnt/d/emhash-master/bench$ ./sb

image

some result from upper picture (high is better), and depends on your system if you want to more benchmark results(hash + key), try to set different marco and retest it again.

ktprime commented 1 year ago

readme updated, it offers some advice on how to choose emhash.