Boost logo

Boost :

Subject: Re: [boost] [range] Performance benchmarks?
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-02-01 16:19:57


on Wed Feb 01 2012, Mathias Gaunard <mathias.gaunard-AT-ens-lyon.org> wrote:

> On 02/01/2012 04:39 PM, Beman Dawes wrote:
>> A question came up in a long bikeshed discussion on a C++ committee
>> mailing list as to the performance of range based interface versus a
>> begin/end iterator interface (I.E. traditional STL interface) to the
>> same algorithms.
>
> It's exactly the same performance, because a range is just a pair of
> begin/end iterators and all the code is implemented using the
> iterators.

No, a range is not _necessarily_ a pair of begin/end iterators. We're
explicitly interested in what happens to efficiency when algorithms are
/implemented/ using range primitives rather than by iterator
increment, comparison, etc.

Andrei Alexandrescu's "Iterators Must Go" suggests a model where there
are no iterator operations visible in algorithm implementations.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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