
17 Jan
2009
17 Jan
'09
4:27 p.m.
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 reduced.