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

Add Map shrinking #11

Merged
merged 3 commits into from
Aug 14, 2021
Merged

Add Map shrinking #11

merged 3 commits into from
Aug 14, 2021

Conversation

puzpuzpuz
Copy link
Owner

@puzpuzpuz puzpuzpuz commented Aug 14, 2021

Closes #5

Adds a striped size counter for Map and shrinking logic based on that counter. The shrinking is only done during Delete and LoadAndDelete calls when the last entry in a bucket chain is deleted. The shrinking happens if the current size is less or equal to 1/16 of minimal capacity of the table (i.e. table_length * number_of_entries_per_bucket).

@puzpuzpuz puzpuzpuz added the enhancement New feature or request label Aug 14, 2021
@puzpuzpuz puzpuzpuz force-pushed the enhancement/map-shrinking branch 2 times, most recently from 4bb474e to 01fb9bf Compare August 14, 2021 17:36
@puzpuzpuz puzpuzpuz force-pushed the enhancement/map-shrinking branch from 01fb9bf to ff85170 Compare August 14, 2021 17:38
@puzpuzpuz puzpuzpuz merged commit 678d6e0 into main Aug 14, 2021
@puzpuzpuz puzpuzpuz deleted the enhancement/map-shrinking branch August 14, 2021 17:40
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

Successfully merging this pull request may close these issues.

Implement shrinking in Map resize
1 participant