Re: [swift-users] Zero cost abstraction 2D Iterator (equivalent to two nested for loops) impossible?

2017-01-10 Thread Step Christopher via swift-users
Perhaps the optimizer unrolls the inner loop, and thus can skip safety checks. Naively, seems trickier to do for the iterator. > El ene. 4, 2017, a las 9:10 PM, Jens Persson via swift-users > escribió: > > I noticed disabling safety checks made the custom Iterator as

Re: [swift-users] Zero cost abstraction 2D Iterator (equivalent to two nested for loops) impossible?

2017-01-04 Thread Jens Persson via swift-users
Thanks, I wonder if it is currently impossible to make it as fast as the nested for loops, ie that some optimizer improvement could fix it. Here's a stripped down version of my code: import QuartzCore // This is just for timing using CACurrentMediaTime() struct Point2DInt { var x: Int