Boost logo

Boost Users :

From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2004-12-20 11:39:27


Stanislas RENAN <stanislas.renan <at> nsktechnologies.com> writes:

>
> Hi,
>
> I've got a performance problem during a test I've done with multi_index
> on MSVC 6.0 SP 6.
> I'm using BOOST 1.32.0 .
> The search performance is comparable with several maps, but
> insertion is dramatically slow : 5mn 30s for 10 000 employees.
>
> Here is my test code :
>
[...]
> #if !defined(NDEBUG)
> #define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING
> #define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
> #endif

I guess here's the culprit. If you're timing the program
in debug mode then the safe mode will kick in, and this is
abismally slower than an unchecked STL. Apart from this,
measuring things in debug mode makes little sense, so you
should:
  1. disable safe mode AND
  2. compile in release
In your particular example, release build automatically
disables safe mode (because of the #if !defined(NDEBUG)
directive.)

I've run your program in release mode in MSVC 6.0 SP5 and my
results are:

Insertion
multi = 62
STL = 63
Recherche
multi = 297
STL = 234

Which are more reasonable. Can you reproduce these
numbers?

HTH

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


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