
David Maisonave wrote:
"David Abrahams" <dave@boost-consulting.com> wrote in message news:<8764o1azuq.fsf@boost-consulting.com>...
Not if you're compiling without mt support on; the thread safety features of shared_ptr just compile away (and I think there's a macro you can use to force them off). Let's compare apples to apples: your reflinked implementation will be slower in a MT environment. I'm not yet convinced it will be faster in a ST environment unless you leave the MT features of shared_ptr turned on.
Currently, my test results don't support your above comment. Please provide the this macro you're referring to. Without this macro, there's no way of testing your claim.
The macro is BOOST_SP_DISABLE_THREADS, but if you're timing only construction, it probably won't matter much. A reference-linked implementation will obviously outperform a reference-counted implementation for simple construction because it doesn't need to allocate a count.