|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-10-23 09:25:01
Ovanes Markarian wrote:
> Now with default macros used, shared_ptr is about 10% slower. If I
> use the quick allocator the speed is only 8% slower. If I enable both
> macros (single-threaded and quick-allocator) shared_ptr is quicker as
> an implementation without shared_ptr. My question now would be if you
> plan or it is already possible to have a policy for specifying
> Threading and Allocator?
You can override the allocator used for the internal allocation of the
control block by using the shared_ptr constructor taking three arguments
(it's a relatively new feature) but judging by the numbers, there isn't much
point in doing so, as the default allocator is good enough. 2% isn't a
significant difference and it may well be the case that the default could be
faster in real code.
Currently there is no way to specify a threading policy.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net