[swift-evolution] For-loop revisited

David Owens II david at owensd.io
Wed Mar 9 09:11:32 CST 2016


And yet, developers spend the vast majority of their time running and validating code in non-optimized builds. 

I'd also refer you to the many, many talks about so called zero-cost abstractions in C++ causing significant overhead in real-time apps/games. I'm still amazed that Swift's only out here is to write a while loop here. 

Sent from my iPhone

> On Mar 9, 2016, at 4:21 AM, Taras Zakharko via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> 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
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list