Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Full fast-path for HAMT #7

Closed
ekmett opened this issue Oct 7, 2019 · 3 comments
Closed

Missing Full fast-path for HAMT #7

ekmett opened this issue Oct 7, 2019 · 3 comments

Comments

@ekmett
Copy link

ekmett commented Oct 7, 2019

When the node in a HAMT is full, you can avoid all the popcounting overhead, which usually makes it worth special casing. Was sad when after 5 minutes of adding random nodes to finally get the root to be made of all 1s that it didn't switch from Many to another case, like we have in unordered-containers. ;)

@vaibhavsagar
Copy link
Owner

This is intentional! I wanted the implementation to be as simple as possible and I copied it straight from https://vaibhavsagar.com/blog/2018/07/29/hamts-from-scratch/. A production-ready implementation would support full nodes and collisions (as indicated in that blog post).

@ekmett ekmett closed this as completed Oct 7, 2019
@vaibhavsagar
Copy link
Owner

@ekmett I updated it with support for Full in a6184f9, thanks for raising this!

@vaibhavsagar
Copy link
Owner

You can test this by using the numbers 0-9, 18-19, 22-23, and 26-27 as keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants