chapel-lang/chapel — pull request #407 by ronawho (2014-09-12 23:19:01+00:00)
Title: Use "C for loop" in DefaultRectangular and remove posStrideIter

Default rectangular used to use a while loop in an iterator instead of
forwarding to ChapelRange as an optimization to avoid using a general strided
range iterator. With C for loops V2 this was changed to call into an optimized
range iterator for positively strided ranges. However, we noticed that for tests
like n-body we had a performance hit because of this.

The reason for this is because forwarding to ChapelRange introduces the
overhead of range construction. The posStridedIter also used alignedLow/High
which meant calls to chpl_diffMod.

In order to avoid these additional (and in the case of defaultrectangular
unnecessary) calls we are using a C for loop in DefaultRectangular. This is a
little unfortunate as we originally only wanted C for loops in ChapelRange, but
we don't envision needing them anywhere else. Since posStridedIter was only
around for DefaultRectangular, I'm removing that as well.