I don't see anything strange with your definitions... In order to try to elucidate what's going on, I'd need some more information:
* Are you using the safe mode and/or the invariant-checking mode described at http://www.boost.org/libs/multi_index/doc/tutorial/debug.html ?
Perfect!!!... Just I had #if !defined(NDEBUG) #define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING #define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE #endif and I haven't defined NDEBUG!!! Now, time is much better than before, but still continues slow than manually.
* You say you're comparing against manual management: can you please explain what this manual management consists in?
I wanted to refer manual management as without using multi-index library.
The code I used is as follows:
-----------------BEGIN CODE-----------------
// Record definition
struct TProcessRec {
std::string text;
u32 inputTimestamp;
// Constructors...
};
enum PRIORITY_LEVEL
{
PRIORITY_NULL,
PRIORITY_LOW,
PRIORITY_DEFAULT,
PRIORITY_HIGH,
PRIORITY_EXPRESS
};
// Key definition
struct QueueMsgKey {
std::string msg_key;
PRIORITY_LEVEL priority;
// Constructors....
};
struct QueueMsgKeyLess {
bool operator()(const QueueMsgKey k1, const QueueMsgKey k2) const
{ return k1.priority!=k2.priority ? k1.priority>k2.priority :
k1.msg_key
* Are you building in release or debug mode? Any difference if you change this?
No. And I use the same program for comparing both forms (insertions with Multi-index and without).
* What's your environment (compiler, OS)?
I'm using g++ 4.3.0 with Boost library 1.35.0 in Linux
* Are you able to isolate this odd behavior in a complete program that you can send to me so that I can reproduce the problem locally?
Copied before Thanks a lot for your time Angel Suñe Marti