Boost logo

Boost Users :

From: Stanislas RENAN (stanislas.renan_at_[hidden])
Date: 2004-12-21 05:41:18


Joaquin M Lopez Munoz a écrit :

> Insertion
> multi = 47
> STL = 78
> Recherche
> multi = 234
> STL = 266
>
> If, instead of this change, I allow your EmployeeMapper
> to contain duplicate values for the age index by
> turning m_byAge into a multimap
you're right, my test program is broken.

> (and doing the necessary
> changes, vg. multimap does not have an operator[]) the
> numbers are:
>
> Insertion
> multi = 62
> STL = 94
> Recherche
> multi = 297
> STL = 312

I've made the changes and see no noticeable difference in figures

before :
multi 16
STL 0
multi 422
STL 468

after :
Insertion
multi = 16
STL = 15
Recherche
multi = 438
STL = 484

switching to release mode, I give the arimthmic average value of 5 runs
because figures are small (so from notes and calculations) :
multi : 3
STL : 0
multi : 137
STL : 131

I see no real difference in performance between both of them (the
accuracy of the measures is not very good).

Here are the changes in the code :
   std::multimap<int, employee *> m_byAge;
   typedef std::multimap<int, employee *>::iterator EMAgeIt;

and

     m_byAge.insert(std::make_pair<int, employee *>(e2->age(), e2));

The next problem I have now is compilation time.
This example has taken 50s to compile on my computer in debug mode, in
its first version.

Now, with the 2 debug defines commented, and the multimap it takes :
- 41s to compile in release mode with MI
- 3s to compile with all BOOST references enclosed in #if defined() that
evaluates to false.
So, on this example, it's 13 times longer.

I wonder why compilation time is so long, and if I can do something to
make things faster.
I'm getting upset with compilation times on a very small test, so I
wonder what it's gonna be in real programs.
Maybe it's an absolute addition, just 40s, whatever the number of
references to MI (any BOOST ?) objects.
But even if it's right, if each file compiled suffers from this additon,
it could make compilation time very long.
That may be considered an acceptable price.

We've got an application here that take several hours to compile. If we
use BOOST library, is this (long) time gonna be 13 times longer ?
That would probably be an unacceptable price.

Maybe there is a document or a discussion regarding this issue ? I've
found nothing neither on the web site nor on the list.
Or am I missing something anew ?

regards,

-- 
Stanislas RENAN

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