Rewrite Map using a hash-balanced tree
The gob-encoded deep copy approach was an easy hack but it failed in
important ways. This complete rewrite uses a binary search tree where
the tree's keys are hashes of the user's desired keys. This makes us
pretty certain the tree will stay reasonably balanced without having
to write a bunch of tree balancing code.
This passes all tests and is about 200x faster than the previous
implementation. I hacked this code together pretty quickly and
there's lots of ugliness and repetitive code in there. I hope to
clean it up soon.
1 file changed