How should I benchmark a new HashMap implementation?

I recently implemented and ran benchmarks on hash tables using several different linear probing algorithms (https://github.com/senderista/hashtable-benchmarks), and I'd like to try porting one of these (bidirectional linear probing) from Java to Rust. I was thinking that I could mostly just reuse the old "Robin Hood" HashMap implementation, since the new probing algorithm is similar to Robin Hood, but I'd like to benchmark my implementation against both the old Robin Hood and the new HashBrown impls. I gather that the porting effort for HashBrown used rustc as a testbed, but are there particular compiler workloads I should test, and are there other benchmarks or microbenchmarks I should use?

If you want to test whether it makes rustc itself faster, then the compiler project has a set of benchmarks https://perf.rust-lang.org/

If you make a pull request to rustc, you can ask someone to run the benchmark suite against your pull request.

1 Like

Thanks!