Boost logo

Boost :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2004-03-01 09:52:46


Peter Dimov ha escrito:

> Pavel Vozenilek wrote:
> >
> > The reasons to use macros instead of RAII is convenience
> > and performance.
>
> Can you elaborate please. I'm slowly coming to the conclusion that any catch
> that can be replaced by RAII should be. Including the one in shared_count.
> ;-)

I think I can contribute here. Earlier versions of indexed_set did extensively
use scopeguards in place of try-catch blocks. When doing the performance
measures, I discovered that scopeguards were introducing a non-negligible
penalty --for instance, a single-indexed indexed_set was 20% slower than
its equivalent std container with scopeguards, and just 10% slower with
try-catch blocks (rough figures.)

See http://tinyurl.com/33e4a for current performance results.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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