[bt-devel] Excessive CPU consumption during module install

Jaak Ristioja Ristioja at gmail.com
Tue Jul 7 12:47:01 MST 2009


Hi!

I've been able to reproduce this with 2.0.1. Here's part of a backtrace
for this situation:

#0  0x00007fa2a733fe2c in sword::FileDesc::getFd () from
/usr/lib/libsword-1.5.11.so
#1  0x00007fa2a732e9cc in sword::SWConfig::Load () from
/usr/lib/libsword-1.5.11.so
#2  0x00007fa2a732f5e1 in sword::SWConfig::SWConfig () from
/usr/lib/libsword-1.5.11.so
#3  0x00007fa2a7332c3e in sword::SWMgr::loadConfigDir () from
/usr/lib/libsword-1.5.11.so
#4  0x00007fa2a7339fae in sword::SWMgr::Load () from
/usr/lib/libsword-1.5.11.so
#5  0x00000000004e6bcc in CSwordBackend::initModules ()

#6  0x000000000055957e in instbackend::backend ()

#7  0x0000000000560209 in BtInstallThread::BtInstallThread ()

#8  0x0000000000562049 in
BtInstallProgressDialog::BtInstallProgressDialog ()

#9  0x0000000000564fea in BtSourceWidget::slotInstallAccepted ()


It appears that the BtInstallProgressDialog constructor creates a
BtInstallThread for every work selected to be installed. The
BtInstallThread constructor calls instbackend::backend, which calls
CSwordBackend::initModules(), which calls sword::SWMgr::Load(). The
latter method takes most CPU time. Multiply that time with the number of
works selected and you got a huge delay.

Unfortunately I'm not familiar with the code, so I have been unable to
produce a fix. I hope you'll figure this out before 2.1. :)

Blessings!
Jaak



More information about the bt-devel mailing list