Boost logo

Boost :

Subject: Re: [boost] [signals2][review] The review of the signals2 library (formerly thread_safe_signals) begins today, Nov 1st
From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2008-11-03 19:31:23


On Monday 03 November 2008 13:31, Michael Marcin wrote:
> Frank Mori Hess wrote:
> > boost::signal, 10 connections, tracking enabled, invoking 1000000
> > times: 0.78 s
> >
> > boost::signals2::signal, 10 connections, tracking enabled, invoking
> > 1000000 times: 4.92 s
>
> Over 6 times slower in this case. That seems to warrant some concern.

Almost 2 seconds of the overhead is due to atomic reference counting for
shared_ptr. If I compile the benchmark with DISABLE_BOOST_THREADS I get:

boost::signals2::signal, 10 connections, tracking enabled, invoking 1000000
times: 3.20 s

Probably an similar sized chunk of overhead is due to a heap allocation
inside the std::vector used to hold the tracked shared_ptr during
invocation. That part is actually something that could be optimized, at
least for slots tracking less than some arbitrary fixed number of
shared_ptr (say 10).




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