Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] benchmark
From: Phil Bouchard (philippe_at_[hidden])
Date: 2011-05-24 20:45:56


On 5/24/2011 5:33 PM, Darren Garvey wrote:
> On 25 May 2011 00:52, Phil Bouchard<philippe_at_[hidden]> wrote:
>
>> I just tested it using make_shared& make_block and I get:
>> make:
>> auto_ptr: 11109841 ns
>> shared_ptr: 21215277 ns
>> block_ptr: 143637475 ns
>>
>> new:
>> auto_ptr 4583447 ns
>> shared_ptr: 10675000 ns
>> block_ptr: 67152785 ns
>
> I wonder if it's that your test case prevents your compiler from performing
> RVO, or that the docs might be incorrect. I wonder what the results look
> like if you instead test:
>
> ```
>
> template<typename T, T (*P)()>
> void worker_make()
> {
> for (int i = 0; i< 100000; ++ i)
> T p = P();
> }

I get a slight improvement:
make:
auto_ptr: 12849529 ns
shared_ptr: 18574307 ns
block_ptr: 126387234 ns

-Phil


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