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