Skip to content

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

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 1, 2018

Conversation

lorentey
Copy link
Member

• 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
@lorentey
Copy link
Member Author

@swift-ci please test

@lorentey
Copy link
Member Author

@swift-ci please nominate

@lorentey lorentey merged commit 34bda52 into swiftlang:swift-4.1-branch Feb 1, 2018
@lorentey lorentey deleted the rdar/36619317-4.1 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