Modify

Opened 6 years ago

Last modified 6 years ago

#6829 new Bugs

[smart_ptr] make_shared is slower than shared_ptr(new) in MSVC

Reported by: mt.wizard@… Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost Development Trunk Severity: Optimization
Keywords: smart_ptr make_shared Cc: mt.wizard@…

Description

boost::make_shared() works much slower than it supposed to in MSVC It uses RTTI to get its custom deleter, and RTTI is painfully slow in MSVC.

Attachments (2)

make_shared_perf.patch (59.2 KB) - added by mt.wizard@… 6 years ago.
More optimal implementation of make_shared: don't use RTTI and don't store exptra pointer to allocated object as its position is know without it
make_shared.hpp (31.8 KB) - added by ierceg@… 6 years ago.
Updated smart_ptr\make_shared.hpp file to look more like the original implementation and with sp_enable_shared_from_this calls that were missing in the patch.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by mt.wizard@…

Attachment: make_shared_perf.patch added

More optimal implementation of make_shared: don't use RTTI and don't store exptra pointer to allocated object as its position is know without it

comment:1 Changed 6 years ago by mt.wizard@…

Component: Nonesmart_ptr
Owner: set to Peter Dimov
Severity: ProblemOptimization

Changed 6 years ago by ierceg@…

Attachment: make_shared.hpp added

Updated smart_ptr\make_shared.hpp file to look more like the original implementation and with sp_enable_shared_from_this calls that were missing in the patch.

comment:2 Changed 6 years ago by anonymous

Is there any way to remove attached file here? Please don't use the make_shared.hpp from attachment.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Peter Dimov.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.