Context:
- https://twitter.com/an0/status/627476411050147840
- http://airspeedvelocity.net/2015/08/03/arrays-linked-lists-and-performance/
Array concatenation optimization is easy. The hard part is ARC optimization. Essentially, the question is whether ARC can eliminate the autorelease_1
& retain_1
pair and just transfer the ownership from obj
to arg
:
// I have to use Objective-C code to demonstrate because there is no Manual Reference Counting in Swift at all.