Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] Up to 600% faster than Shared Pointer
From: Phil Bouchard (philippeb8_at_[hidden])
Date: 2016-03-12 12:37:29


On 03/11/2016 11:12 PM, Glen Fernandes wrote:
> On Fri, Mar 11, 2016 at 9:38 PM, Phil Bouchard <philippeb8_at_[hidden]> wrote:
>>
>> new:
>> auto_ptr: 23174753 ns
>> shared_ptr: 49726615 ns
>> block_ptr: 7812659 ns
>>
>
> Hi Phil,
>
> What exactly are you measuring here? The time taken to construct an
> std::auto_ptr<T>/std::shared_ptr<T>/block_ptr<T> inclusive of the time
> taken for ::operator new(std::size_t) and inclusive of the
> value-initialization T::T() ?

Yes but it also calls ::operator delete(void *) and T::~T().

If I don't use fastblock<>() then it's a simple 150% speedup compared to
shared_ptr<>:

new:
auto_ptr: 22279670 ns
shared_ptr: 47428316 ns
block_ptr: 31287440 ns

My point with fastblock<>() is that it can be use very easily because it
is already integrated.


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