Boost logo

Boost :

Subject: Re: [boost] [smart_ptr] make_shared performance
From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2009-01-17 11:27:37

On Friday 16 January 2009 16:40, Frank Mori Hess wrote:
> I've been doing a little benchmarking (trivial benchmark program
> attached) of boost::make_shared performance. With svn trunk, I don't
> see much improvement from using make_shared, in fact for large objects
> it is much slower. I would guess this is due to the increased overhead
> of copying sp_ms_deleter for large types.

The attached patch to boost/make_shared.hpp adds an optimized copy
constructor to sp_ms_deleter which reduces overhead for large types. It
improves the running time of the benchmark I posted before from 13+
seconds on my computer to 3+ seconds. The sp_ms_deleter still gets copy
constructed 3 times during a make_shared call, which can probably be

Boost list run by bdawes at, gregod at, cpdaniel at, john at