Skip to content

Overhaul of the once crate #192

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JoeyBF
Copy link
Collaborator

@JoeyBF JoeyBF commented Mar 25, 2025

This almost completely overhauls the once. We keep OnceVec and OnceBiVec and their API, but they are now backed by a more well-behaved data structure I call a Grove, for "grow vector". Bikeshedding welcome for the name.

The new MultiIndexed<K, V> struct is what I had in mind in #187 (comment). As the criterion benchmark shows, its performance is comparable to nested OnceBiVecs for insertion, sometimes even faster. It also offers more flexibility like natively out-of-order insertions and arbitrarily negative coordinates.

I added doctests, unit tests, proptests and tests using loom to test against strange thread scheduling. Also probably too much documentation. Sorry for the large diff

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

Successfully merging this pull request may close these issues.

1 participant