On 12/23/10 7:04 AM, spir wrote:
On Wed, 22 Dec 2010 22:14:34 -0600
Andrei Alexandrescu<seewebsiteforem...@erdani.org>  wrote:

I then replaced iota's implementation with a simpler one that's a
forward range. Then the performance became exactly the same as for the
simple loop.


After having watched Iota's very general implementation, I tried the same 
change, precisely. Actually, with an even simpler range requiring a single 
element type for (first,last,step). For any reason, this alternative is 
slightly slower by me than using Iota (don't cry watching absolute times, my 
computer is old and slow ;-). Sample code below, typical results are:

1.1 3.3 5.5 7.7
Interval time: 1149
Iota time: 1066

Note: adding an assert to ensure front or popfront is not wrongly called past 
the end adds ~ 20% time.

I cut my losses reading here :o). No performance test is meaningful without all optimizations turned on.

Andrei

Reply via email to