Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2003-01-29 17:01:35


"Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
news:b19hhg$i2m$1_at_main.gmane.org...
> [...]
> list shifted_ptr<T> took 0.0002951000 seconds to construct.
> list shifted_ptr<T> took 7.1966276647 seconds to reconstruct 2000
> times.
> list shifted_ptr<T> took 5.0495961000 seconds to copy 2000 times.
> list shifted_ptr<T> took 4.0016951000 seconds to sort 4000 times.
> list shifted_ptr<T> took 0.1382300647 seconds to swap 500 times.
> list shifted_ptr<T> took 0.0003241000 seconds to destroy.
> [...]
> list shared_ptr<T> took 0.0004259000 seconds to construct.
> list shared_ptr<T> took 14.0157271000 seconds to reconstruct 2000 times.
> list shared_ptr<T> took 5.0331178000 seconds to copy 2000 times.
> list shared_ptr<T> took 4.0376376000 seconds to sort 4000 times.
> list shared_ptr<T> took 0.1449102647 seconds to swap 500 times.
> list shared_ptr<T> took 0.0004831000 seconds to destroy.

Looks like your lead is getting eroded by the day. ;) And that's just
with a quick hack. You better be worried about a serious small
object allocator. Not only that, but the items that seem most important
to me are copy, sort, and swap, since those are the most frequent or
computationally intensive. And in those three categories, you have
virtually no advantage. In fact, shared_ptr beats shifted_ptr in copy???
What happened? The sort speed amounts to < 1% difference. Even
swap amounts to about a 5% diff. This is very telling. The biggest
speed difference is during construction, and that is where shared_ptr
is least optimized.

Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk