Boost logo

Boost :

Subject: Re: [boost] Constant iterator of Single Pass Range
From: Eric Niebler (eniebler_at_[hidden])
Date: 2014-05-06 21:56:53


On 5/6/2014 1:33 PM, Neil Groves wrote:
> I have done extensive performance measurements upon various arrangements of
> having data in iterators versus ranges. I have been surprised how many
> times a bloated iterator outperforms the indirection to a separate range
> object.

In my (admittedly limited) testing, I agree. In some places in my code,
I've re-bloated iterators I had previously un-bloated simply for
performance reasons. But I've also noticed that at least in some
situations, the optimizer can see through the pointer-to-range stored in
the iterator. That happens when the use of the iterator is not far from
where the iterator was created.

\e


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk