Subject: Re: [boost] lifetime of ranges vs. iterators
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2008-09-04 14:51:55
Steven Watanabe wrote:
> David Abrahams wrote:
>> I think the optimizer can remove some redundant tests if the functions
>> are inlined. But, that said, I am becoming more and more convinced as
>> this discussion goes on that compressing stacked iterator adaptors is
>> barking up the wrong tree if you care about efficiency. The difference
>> between the code generated in the abstracted case and the code you'd
>> write by hand is simply too great.
>> No, I don't have a picture of a better solution yet. But it's an
>> interesting problem.
> Here are some measurements for my current version of filter_iterator
> In brief:
> 4 function objects containing two integers each: 3.39 seconds
> 4 stateless function objects: 2.813 seconds
> 4 stateless function objects combined using phoenix's && rather than
> stacked iterators: 2.563 seconds
> 1 stateless function object 2.015 seconds
> raw for loop using vector iterators 2.516 seconds
> raw for loop using pointers: 1.703 seconds
> These were all doing the same calculation over the same underlying vector.
I ran your attached test on VC9 SP1 default console app release mode
with _SECURE_SCL=0 on my Core 2 Quad Q6600 2.4Ghz with 4GB of RAM
Press any key to continue . . .
Are these all truly doing the same work?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk