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

Iteration #2

Open
withinboredom opened this issue May 24, 2021 · 0 comments
Open

Iteration #2

withinboredom opened this issue May 24, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@withinboredom
Copy link
Owner

It should be possible to iterate over the map, count items, etc in a pretty economic way.

Iteration can be done simply by iterating over all the items, which should allow IDictionary (C#) and Iterable (PHP) interfaces to be implemented. I didn't implement it initially due to performance concerns, but those seem to be a non-issue??

Counting can be done by looking at the current generation and generating larger-spanned buckets that can be very quickly iterated without much contention. For example, generation 1 maps only cover 256 buckets, so dividing that into 4 buckets (for reads) to sum the count makes a lot of sense, while larger maps (>generation 4) might benefit from more divisions (more reads) but less potential for write contention.

@withinboredom withinboredom added the enhancement New feature or request label May 24, 2021
@withinboredom withinboredom self-assigned this May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant