Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] benchmark
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-05-26 20:15:38


Phil Bouchard wrote:
> On 5/26/2011 3:02 PM, Phil Bouchard wrote:
...
> > xor %edi,%edi
> > callq 0x405058 <_ZdlPv_at_plt> (operator delete)
> ...
>
> On each iteration worker_make calls delete explaining why it is twice
> slower than worker_new. I'm not sure what it is deleting.

It looks like it calls delete with NULL. This is probably the destructor of
the temporary auto_ptr, whose pointer is NULL after the assignment.

Does your test use rvalue references by the way (-std=c++0x)? shared_ptr has
a move assignment and should be able to take advantage of that to avoid some
of the overhead imposed by the remaining temporary (-ies). Also, the
trunk/release make_shared should be better than the one in 1.46.1 (although
I don't know how relevant is this for such a small pointee as int.)


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