|
Boost : |
Subject: Re: [boost] [Block Pointer] Up to 600% faster than Shared Pointer
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2016-03-13 11:24:17
On Sun, Mar 13, 2016 at 11:14 AM, Phil Bouchard wrote:
> I keep cleaning up the code and now I think it is very easy to understand:
>
I quickly threw together a more tidy basis for your benchmark, you can
find the code at:
https://github.com/philippeb8/block_ptr/issues/1
I tested it on g++ 5.3. You can compile and run with:
g++ -std=c++14 -O2 -o benchmark benchmark.cpp && ./benchmark
Results on one machine:
unique_ptr (new): 81.2868
unique_ptr (make_unique): 83.2583
shared_ptr (new): 139.141
shared_ptr (make_shared): 84.8653
It might address one of the concerns Rob had with your benchmark (e.g.
your use of function pointers).
Should be trivial for you to add the additional cases: shared_ptr
(allocate_shared with fast_pool_allocator) and block_ptr to it.
Glen
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk