This repository contains add, contains, and remove benchmarks for these hash sets:
This is a cuckoo hash set used in libgdx and Kryo for many years. It has some advantages, notably constant worst lookup time. It has a major disadvantage though: if > ~50 keys have the same hash codes, it fails because the backing array is doubled until it runs out of memory.
This is convenient since it comes with the JRE. It uses chaining and generally has good properties, except that it allocates when items are added. Allocation makes it not a good fit for games or other applications that need to avoid GC.
This is a linear probing hash set that uses the backward shift algorithm for removal. Hashcodes are rehashed using Fibonacci hashing, instead of the more common power of two mask, to better distribute poor hashCodes (see Malte Skarupke's blog post). Linear probing continues to work even when all hashcodes collide, just more slowly (O(n) worst case).


