Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2007-04-30 15:23:04


Hello Manuel,

----- Mensaje original -----
De: Manuel Jung <gzahl_at_[hidden]>
Fecha: Lunes, Abril 30, 2007 7:49 pm
Asunto: [Boost-users] [Multi_index] Performance like sequenced.cpp
example
Para: boost-users_at_[hidden]

> Hi,
>
> I have to count a lot of words. Up to now i did it with MySQL,
> because it
> was easy. The result is safed there anyway. Now i thought i could
> speed up this a little if i would use internally a Multi_index
> list to store the words, so i have only to insert all different
> words. The words are storedin a UnicodeString from the ICU
> library. My code is really near to the one from the example
> "sequenced.cpp".
> Im using the following definition:
>
> typedef multi_index_container<
> UnicodeString,
> indexed_by<
> sequenced<>,
> ordered_non_unique<identity<UnicodeString> >
> >
> > text_container;
> typedef nth_index<text_container,1>::type ordered_text;
> text_container tc;
>
>
> Im inserting new words with "tc.push_back(UnicodeString(NewWord));"
> And count them exactly like in the example. I thought this should
> be fast, but it isnt. It eats up all my CPU, but isnt fast. It
> is a lot slower than my old solution.
> I have still hope i could speed this up, before i have to switch
> back MySQL.
> The profile of a run says
> that "boost::multi_index::safe_mode::check_same_owner<..." eats
> most CPU time.

This trace indicates that you've set Boost.MultiIndex safe mode
on; this and its companion invariant-checking mode are huge
CPU eaters, only intended for catching programming errors
in debug builds. Please turn them off and time again: is the
performance adequate now?

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