[swift-evolution] For-loop revisited

Taras Zakharko taras.zakharko at uzh.ch
Wed Mar 9 06:21:35 CST 2016


> On 09 Mar 2016, at 00:01, Ted F.A. van Gaalen via swift-evolution <swift-evolution at swift.org> wrote:
> 
> However, in the real world, especially when working with technical 
> and scientific data and for instance in time critical applications 
> like 3D presentations fast iterations become a necessity.

There is no reason why collection-based iteration can’t be as fast as a classical C for loop. The compiler should be able to optimise all the overhead away. , even unroll shorter loops. Maybe it doesn’t do it yet. I’d rather see resources invested into improving the compiler to inline/unroll code better where appropriate rather then introducing additional syntax to support a marginal use case. 

— Taras




More information about the swift-evolution mailing list