I was reading some of the internal implementations in the stdlib and noticed that none of the decodable collections in stdlib reserve capacity before appending decoded elements.
https://github.com/apple/swift/blob/master/stdlib/public/core/Codable.swift.gyb#L1752-L1768
https://github.com/apple/swift/blob/master/stdlib/public/core/Codable.swift.gyb#L1786-L1802
https://github.com/apple/swift/blob/master/stdlib/public/core/Codable.swift.gyb#L1820-L1852
https://github.com/apple/swift/blob/master/stdlib/public/core/Codable.swift.gyb#L1893
Do I miss something or why wouldn't we just include this line everywhere?
container.count.map(reserveCapacity)