Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-06-20 17:51:32


Thorsten Ottosen wrote:
> Michael Marcin skrev:
>> Thorsten Ottosen wrote:
>
>>> I'll try to investigate this.
>>>
>>
>> I appreciate it.
>> If you have things you'd like me to try out I can compile them and
>> send you the mixed assembly output.
>>
>> One thing I noticed is that it seems to fail to eliminate the return
>> value copy of the void_ptr_iterator::base call. Accessing iter_
>> directly (unfortunately) produces much better code but still not the
>> best.
>
> I have tried playing a little with your example, eg. using operator[]
> instead.
>
> To my surprise, I could not eliminate the overhead with vc8 (/Ox /Og).
> Thus the iterator wrapping seems to pay some penalty. This is quite
> strange IMO.

It's possible that the implementation in terms of vector<void*> is
introducing too much abstraction for the compiler to handle. Have you
considered simply using vector<T*> and leaving the void* folding to the
standard library?

Judging by the ARM assembly, I wouldn't be surprised if vector<T>::iterator
is T* on this compiler, decreasing the abstraction penalty even further.


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