Skip to content

[5.0][stdlib] Set, Dictionary: Take the max load factor into account in .init(minimumCapacity:) #14341

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

Merged
merged 1 commit into from
Feb 2, 2018

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Feb 1, 2018

• Explanation: Set, Dictionary.init(minimumCapacity:) did not allocate enough storage to actually hold the requested number of items.
• Scope of Issue: Mostly a performance issue; it results in one unexpected storage reallocation while elements are added to the collection.
• Origination: It looks like this has been like this forever.
• Risk: Low risk. Increasing allocated capacity is unlikely to break code.
• Reviewed By: @natecook1000
• Testing: Stdlib regression tests, including new tests.
• Radar / SR: rdar://problem/36619317

…in .init(minimumCapacity:)

rdar://problem/36619317
(cherry picked from commit 34bda52)
@lorentey
Copy link
Member Author

lorentey commented Feb 1, 2018

@swift-ci please test

@lorentey lorentey merged commit cb97d94 into swiftlang:swift-5.0-branch Feb 2, 2018
@lorentey lorentey deleted the rdar/36619317-5.0 branch April 30, 2018 19:16
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