Hello Racketeers,
I'm looking for examples of code that would make good benchmarks for
evaluating the performance of immutable hashes.
Some background:
Immutable hashes used to be implemented in Racket as red-black trees.
That was changed to hash array mapped tries (HAMTs) a number of years
back. In Racket CS, the current implementation is a Patricia trie.
That choice was based largely on the fact that it performed
significantly faster on the hash demo benchmarks[1] that any of the
HAMT variants I tested against. In particular, the write performance
of the HAMTs seemed especially poor.
However, on some real-world code[2] I recently had occasion to test, a
HAMT consistently performs better than the Patricia trie, _especially_
on writes, which makes me think I put entirely too much weight on the
hash demo benchmark.
So I'm looking for more realistic cases to use for benchmarking. If
you have a Racket application or library that makes heavy use of
immutable hashes or hash sets (from the racket/set module), please let
me know.
Thanks,
Jon
[1]
https://github.com/racket/racket/blob/master/racket/src/cs/demo/hash.ss
I also tried to use the expander demo as a benchmark, but the timings
weren't significantly different with different hash implementations.
[2]
https://github.com/racket/racket/pull/2766#issuecomment-520173585
Well, it's a lot closer to real-world code than the hash demo.