|
Boost : |
Subject: Re: [boost] [Block Pointer] benchmark
From: Phil Bouchard (philippe_at_[hidden])
Date: 2011-05-25 19:55:45
On 5/25/2011 4:15 PM, Phil Endecott wrote:
>
> That effect should be immeasurably small, or eliminated entirely by the
> compiler.
>
> I think you had better post your benchmark code. There must surely be
> something else going on here.
In debug mode I see that:
1) worker_name() run by auto_ptr calls the following on each iteration:
- make_auto<int>()
- operator new
- auto_ptr::auto_ptr(int *)
- operator auto_ptr_ref ()
- auto_ptr::auto_ptr(auto_ptr_ref())
- ~auto_ptr
- auto_ptr_ref<int>()
...
- auto_ptr<int>::operator = (auto_ptr_ref<int>)
...
- auto_ptr<int>::~auto_ptr<int>()
...
2) worker_new() run by auto_ptr simply calls
- operator new
- auto_ptr<int>::reset(int *)
I haven't debugged the release mode but we see that there is a lot of
work to do to optimize worker_name() run by auto_ptr
-Phil
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk