We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39dc431 commit 2aec2d5Copy full SHA for 2aec2d5
Sources/ArrayModule/DynamicArray.swift
@@ -261,7 +261,9 @@ extension DynamicArray where Element: ~Copyable {
261
@_alwaysEmitIntoClient
262
@_transparent
263
internal func _growDynamicArrayCapacity(_ capacity: Int) -> Int {
264
- 2 * capacity
+ // A growth factor of 1.5 seems like a reasonable compromise between
265
+ // over-allocating memory and wasting cycles on repeatedly resizing storage.
266
+ 3 * capacity / 2
267
}
268
269
extension DynamicArray where Element: ~Copyable {
0 commit comments