[Coin-lpsolver] Sbb: Use of setTestForDuplicateIndex and CoinMessages

Jean-Sebastien Roy js at jeannot.org
Wed Mar 31 12:35:21 EST 2004


Hi !

I did some profiling of Sbb (I know it's not even version 1.0, but it 
works quite well already !), and made some observations written below.

The CoinPackedVectorBase::setTestForDuplicateIndex seems to test wether 
multiple indices share the same value in the sparse vector (am I right 
?). For that, it creates a std::set using CoinPackedVectorBase::indexSet 
and possibly throw an error.
A run of Sbb using a profiler revealed that on the problems I'm solving, 
a very large part of the time is spent in this function (more than 20%. 
It varies between platforms (Sun or Linux)).

Since, it looks like a debug test, I removed the test (in 
CoinPackedVector::setFull), without any apparent ill effect. Is it 
reasonnable ? Should it be enabled for debug versions only ?

The profiler runs revealed that the second most time consuming task was 
ClpMessage::ClpMessage (allong with all *Message functions) which is 
building the message table for output. It seems to be called extremely 
often (in ClpModel::ClpModel and ClpModel::newLanguage), and takes very 
long since it requires a lot of strdup, strcpy, malloc and free. Like 
the previous line, it's almost 20% of the time spent (even when no 
messages are output).

I thought it could be nice to be able to perform the message table 
building only once. Since I do not understand the Clp code yet, I just 
disabled most of the CoinMessage functionnality.

Regards,

js




More information about the Clp mailing list