Now we initialize the array buffer from sequences using unsafe pointer
arithmetic, which avoids extra retain/release traffic. But since the
size of the sequence is not known in advance, we only initialize as much
as underestimateCount() promises, and fall back to the slow approach for
the tail. Nevertheless, for collections, where the size is known
precisely, this technique is suboptimal only by one branch.
rdar://20530390
Swift SVN r27380
This allows array types to get the best performance. The default
implementation for range replaceable collections appends elements one by
one, and the optimizer can't hoist uniqueness checks from the loop in
that case yet.
Swift SVN r27314
Array(other_collection) is using an optimized code path for copying
collections. An explicit for loop does not.
This commit should recover the performance regression in
rdar://20530390.
Swift SVN r27313