On Saturday, 27 September 2014 at 22:11:39 UTC, H. S. Teoh via
Digitalmars-d wrote:
I vaguely recall somebody mentioning a while back that
range-based code
is poorly optimized because compilers weren't designed to
recognize
such patterns before. I wonder if there are ways for the
compiler to
recognize range primitives and apply special optimizations to
them.
I do find, though, that gdc -O3 generally tends to do a pretty
good job
of reducing range-based code to near-minimal assembly. Sadly,
dmd is
changing too fast for gdc releases to catch up with the latest
and
greatest, so I haven't been using gdc very much recently. :-(
That was me, specifically for LLVM (I don't know much about GCC's
innards). Hopefully, this is being worked (as it also impact
C++'s stdlib).