I have just released FSet 1.6.0, which completes the work on CHAMP sets and maps that I started months ago.
CHAMP is a hash-based data structure by Michael Steindorfer, that improves a little on Phil Bagwell's widely-used HAMT. (The HAMT is used, for example, by Clojure.)
See the GitLab MR for the details of how to use it.
I did some quick micro-benchmarking, using sets of integers, comparing CHAMP against my older weight-balanced trees. On lookup (testing whether a value is in the set), CHAMP is about twice as fast at size 4, growing to almost 5x faster at size 2048. On update (adding an element to the set, with about a 25% chance that it's already there), CHAMP is roughly even with WB at size 4, but over 40% faster at size 2048.
So to summarize, there's a significant and welcome improvement in update performance, and quite a remarkable improvement in lookup performance. W00t!
No comments:
Post a Comment