Hashset benchmark can be improved to better highlight impact of Hasher.
Use contains instead of insert. insert may resize, and will perform equality checks since the item is present after the first iteration (thus after finding the buckets the set performs an equality check). All of this is extra computation that is not relevant to hashing, and dilute the results.
Pass string and set to benchmark in a non-inlined method, to prevent some unwanted compiler optimizations
Hashset benchmark can be improved to better highlight impact of
Hasher
.contains
instead ofinsert
.insert
may resize, and will perform equality checks since the item is present after the first iteration (thus after finding the buckets the set performs an equality check). All of this is extra computation that is not relevant to hashing, and dilute the results.