View Revisions: Issue #15711

Summary 0015711: scribus is slow starting up
Revision 2019-06-13 11:15 by jghali
Description When I open scribus without a document, cancel the new document window, and then close scribus, the process takes about 15 seconds. It used to be much faster in previous versions. I built scribus 1.5.5.svn from source. I have a 4 core 2.5 GHz i5 laptop.
I rebuild scribus with profiling. (I attached a patch to enable profiling with -DWANT_PROFILE)
It looks like the problem is sorting a qStringList in either plugins, icons or color palettes.

Here are the top items in the profile:

  % cumulative self self total
 time seconds seconds calls ms/call ms/call name
 16.67 0.03 0.03 2427252 0.00 0.00 QList<QString>::iterator::operator*() const
 16.67 0.06 0.03 864415 0.00 0.00 std::__atomic_base<int>::operator--()
  5.56 0.07 0.01 663961 0.00 0.00 QList<QString>::iterator::operator<(QList<QString>::iterator const&) const
  5.56 0.08 0.01 584944 0.00 0.00 QListData::size() const
  5.56 0.09 0.01 574334 0.00 0.00 QString::QString(QString const&)
  5.56 0.10 0.01 572238 0.00 0.00 bool QAtomicOps<int>::ref<int>(std::atomic<int>&)
  5.56 0.11 0.01 572238 0.00 0.00 std::__atomic_base<int>::operator++()
  5.56 0.12 0.01 277527 0.00 0.00 QList<FileFormat>::Node::t()
  5.56 0.13 0.01 152762 0.00 0.00 QHash<QString, QHashDummyValue>::insert(QString const&, QHashDummyValue const&)
  5.56 0.14 0.01 152762 0.00 0.00 QHash<QString, QHashDummyValue>::findNode(QString const&, unsigned int) const
  5.56 0.15 0.01 148851 0.00 0.00 QSet<QString>::const_iterator::operator!=(QSet<QString>::const_iterator const&) const
  5.56 0.16 0.01 2996 0.00 0.00 QList<VColorStop*>::detach()
  5.56 0.17 0.01 1354 0.01 0.01 QMapNode<QString, QPointer<ScrAction> >::nextNode()
  5.56 0.18 0.01 95 0.11 0.11 qstrnlen(char const*, unsigned int)

Here are some of the top call graphs:

index % time self children called name
                                                 <spontaneous>
[1] 61.2 0.00 0.11 ImIconProvider::icon(QFileInfo const&) const [1]
                0.00 0.11 1957/1957 LoadSavePlugin::getExtensionsForImport(int) [2]
                0.00 0.00 1957/37359 QStringList::~QStringList() [58]
                0.00 0.00 9521/843820 QString::~QString() [21]
                0.00 0.00 4651/40222 QString::QString(char const*) [2290]
                0.00 0.00 2435/3229 QString::toLower() && [2400]
                0.00 0.00 2194/5377 QStringList::contains(QString const&, Qt::CaseSensitivity) const [2357]
                0.00 0.00 1957/6889 QString::isEmpty() const [2346]
                0.00 0.00 478/37606 QString::operator=(QString&&) [2292]
-----------------------------------------------
                0.00 0.11 1957/1957 ImIconProvider::icon(QFileInfo const&) const [1]
[2] 60.8 0.00 0.11 1957 LoadSavePlugin::getExtensionsForImport(int) [2]
                0.00 0.04 1957/1959 void qSort<QStringList>(QStringList&) [8]
                0.00 0.03 1957/1959 QList<QString>::toSet() const [11]
                0.00 0.02 1957/1960 QSet<QString>::toList() const [27]
                0.00 0.01 264195/264705 QList<FileFormat>::const_iterator::operator->() const [47]
                0.00 0.01 66538/66600 QList<QString>::append(QList<QString> const&) [52]
                0.00 0.00 1957/1960 QStringList::operator=(QList<QString>&&) [167]
                0.00 0.00 1957/76150 QList<QString>::~QList() [28]
                0.00 0.00 1957/1971 LoadSavePlugin::findFormat(unsigned int, LoadSavePlugin*, QList<FileFormat>::iterator) [169]
                0.00 0.00 1957/1962 QSet<QString>::~QSet() [321]
                0.00 0.00 68495/68604 QList<FileFormat>::const_iterator::operator!=(QList<FileFormat>::const_iterator const&) const [2285]
                0.00 0.00 66538/66644 QList<FileFormat>::const_iterator::operator++() [2287]
                0.00 0.00 1957/2110 QList<FileFormat>::begin() [2442]
                0.00 0.00 1957/1959 QList<FileFormat>::const_iterator::const_iterator(QList<FileFormat>::iterator const&) [2465]
                0.00 0.00 1957/1960 QList<FileFormat>::constEnd() const [2464]
                0.00 0.00 1957/4455 QStringList::QStringList() [2366]
-----------------------------------------------
                0.00 0.04 1959/1959 void qSort<QStringList>(QStringList&) [8]
[10] 22.0 0.00 0.04 1959 void QAlgorithmsPrivate::qSortHelper<QList<QString>::iterator, QString>(QList<QString>::iterator, QList<QString>::iterator, QString const&) [10]
                0.00 0.04 1959/1959 void QAlgorithmsPrivate::qSortHelper<QList<QString>::iterator, QString, qLess<QString> >(QList<QString>::iterator, QList<QString>::iterator, QString const&, qLess<QString>) [9]
                0.00 0.00 3918/266388 QList<QString>::iterator::iterator(QList<QString>::iterator const&) [2256]
-----------------------------------------------
                0.00 0.00 2/1959 LoadSavePlugin::getExtensionsForPreview(int) [253]
                0.00 0.03 1957/1959 LoadSavePlugin::getExtensionsForImport(int) [2]
[11] 18.3 0.00 0.03 1959 QList<QString>::toSet() const [11]
                0.00 0.03 152762/152762 QSet<QString>::insert(QString const&) [19]
                0.00 0.00 156680/159362 QList<QString>::size() const [93]
                0.00 0.00 152762/153432 QList<QString>::at(int) const [96]
                0.00 0.00 1959/1959 QSet<QString>::reserve(int) [1109]
                0.00 0.00 1959/1961 QSet<QString>::QSet() [2458]
-----------------------------------------------
                0.00 0.00 2/2427252 ColorSetManager::findPalettes(QTreeWidgetItem*) [351]
                0.00 0.00 3/2427252 ScribusQApp::getLang(QString) [363]
                0.00 0.00 5/2427252 IconManager::readIconConfigFiles() [476]
                0.00 0.00 9/2427252 PrefsManager::WritePref(QString const&) [208]
                0.00 0.00 14/2427252 ColorSetManager::findPaletteLocations() [575]
                0.00 0.00 30/2427252 ActionManager::connectModeActions() [1331]
                0.00 0.00 52/2427252 ActionManager::enableActionStringList(QMap<QString, QPointer<ScrAction> >*, QStringList*, bool, bool, QString const&) [1181]
                0.00 0.00 60/2427252 ActionManager::initToolsMenuActions() [384]
                0.00 0.00 104/2427252 ActionManager::initUnicodeActions(QMap<QString, QPointer<ScrAction> >*, QWidget*, QStringList*) [376]
                0.00 0.00 1959/2427252 void qSort<QStringList>(QStringList&) [8]
                0.00 0.00 31696/2427252 UnicodeSearchModel::UnicodeSearchModel(QObject*) [26]
                0.03 0.00 2393318/2427252 void QAlgorithmsPrivate::qSortHelper<QList<QString>::iterator, QString, qLess<QString> >(QList<QString>::iterator, QList<QString>::iterator, QString const&, qLess<QString>) [9]
[12] 16.7 0.03 0.00 2427252 QList<QString>::iterator::operator*() const [12]
                0.00 0.00 2427252/2652218 QList<QString>::Node::t() [2238]
-----------------------------------------------
Revision 2019-06-13 04:46 by william
Description When I open scribus without a document, cancel the new document window, and then close scribus, the process takes about 15 seconds. It used to be much faster in previous versions. I built scribus 1.5.5.svn from source. I have a 4 core 2.5 GHz i5 laptop.
I rebuild scribus with profiling. (I attached a patch to enable profiling with -DWANT_PROFILE)
It looks like the problem is sorting a qStringList in either plugins, icons or color palettes.

Here are the top items in the profile:

  % cumulative self self total
 time seconds seconds calls ms/call ms/call name
 16.67 0.03 0.03 2427252 0.00 0.00 QList<QString>::iterator::operator*() const
 16.67 0.06 0.03 864415 0.00 0.00 std::__atomic_base<int>::operator--()
  5.56 0.07 0.01 663961 0.00 0.00 QList<QString>::iterator::operator<(QList<QString>::iterator const&) const
  5.56 0.08 0.01 584944 0.00 0.00 QListData::size() const
  5.56 0.09 0.01 574334 0.00 0.00 QString::QString(QString const&)
  5.56 0.10 0.01 572238 0.00 0.00 bool QAtomicOps<int>::ref<int>(std::atomic<int>&)
  5.56 0.11 0.01 572238 0.00 0.00 std::__atomic_base<int>::operator++()
  5.56 0.12 0.01 277527 0.00 0.00 QList<FileFormat>::Node::t()
  5.56 0.13 0.01 152762 0.00 0.00 QHash<QString, QHashDummyValue>::insert(QString const&, QHashDummyValue const&)
  5.56 0.14 0.01 152762 0.00 0.00 QHash<QString, QHashDummyValue>::findNode(QString const&, unsigned int) const
  5.56 0.15 0.01 148851 0.00 0.00 QSet<QString>::const_iterator::operator!=(QSet<QString>::const_iterator const&) const
  5.56 0.16 0.01 2996 0.00 0.00 QList<VColorStop*>::detach()
  5.56 0.17 0.01 1354 0.01 0.01 QMapNode<QString, QPointer<ScrAction> >::nextNode()
  5.56 0.18 0.01 95 0.11 0.11 qstrnlen(char const*, unsigned int)

Here are some of the top call graphs:

index % time self children called name
                                                 <spontaneous>
[1] 61.2 0.00 0.11 ImIconProvider::icon(QFileInfo const&) const [1]
                0.00 0.11 1957/1957 LoadSavePlugin::getExtensionsForImport(int) [2]
                0.00 0.00 1957/37359 QStringList::~QStringList() [58]
                0.00 0.00 9521/843820 QString::~QString() [21]
                0.00 0.00 4651/40222 QString::QString(char const*) [2290]
                0.00 0.00 2435/3229 QString::toLower() && [2400]
                0.00 0.00 2194/5377 QStringList::contains(QString const&, Qt::CaseSensitivity) const [2357]
                0.00 0.00 1957/6889 QString::isEmpty() const [2346]
                0.00 0.00 478/37606 QString::operator=(QString&&) [2292]
-----------------------------------------------
                0.00 0.11 1957/1957 ImIconProvider::icon(QFileInfo const&) const [1]
[2] 60.8 0.00 0.11 1957 LoadSavePlugin::getExtensionsForImport(int) [2]
                0.00 0.04 1957/1959 void qSort<QStringList>(QStringList&) [8]
                0.00 0.03 1957/1959 QList<QString>::toSet() const [11]
                0.00 0.02 1957/1960 QSet<QString>::toList() const [27]
                0.00 0.01 264195/264705 QList<FileFormat>::const_iterator::operator->() const [47]
                0.00 0.01 66538/66600 QList<QString>::append(QList<QString> const&) [52]
                0.00 0.00 1957/1960 QStringList::operator=(QList<QString>&&) [167]
                0.00 0.00 1957/76150 QList<QString>::~QList() [28]
                0.00 0.00 1957/1971 LoadSavePlugin::findFormat(unsigned int, LoadSavePlugin*, QList<FileFormat>::iterator) [169]
                0.00 0.00 1957/1962 QSet<QString>::~QSet() [321]
                0.00 0.00 68495/68604 QList<FileFormat>::const_iterator::operator!=(QList<FileFormat>::const_iterator const&) const [2285]
                0.00 0.00 66538/66644 QList<FileFormat>::const_iterator::operator++() [2287]
                0.00 0.00 1957/2110 QList<FileFormat>::begin() [2442]
                0.00 0.00 1957/1959 QList<FileFormat>::const_iterator::const_iterator(QList<FileFormat>::iterator const&) [2465]
                0.00 0.00 1957/1960 QList<FileFormat>::constEnd() const [2464]
                0.00 0.00 1957/4455 QStringList::QStringList() [2366]
-----------------------------------------------
                0.00 0.04 1959/1959 void qSort<QStringList>(QStringList&) [8]
[10] 22.0 0.00 0.04 1959 void QAlgorithmsPrivate::qSortHelper<QList<QString>::iterator, QString>(QList<QString>::iterator, QList<QString>::iterator, QString const&) [10]
                0.00 0.04 1959/1959 void QAlgorithmsPrivate::qSortHelper<QList<QString>::iterator, QString, qLess<QString> >(QList<QString>::iterator, QList<QString>::iterator, QString const&, qLess<QString>) [9]
                0.00 0.00 3918/266388 QList<QString>::iterator::iterator(QList<QString>::iterator const&) [2256]
-----------------------------------------------
                0.00 0.00 2/1959 LoadSavePlugin::getExtensionsForPreview(int) [253]
                0.00 0.03 1957/1959 LoadSavePlugin::getExtensionsForImport(int) [2]
[11] 18.3 0.00 0.03 1959 QList<QString>::toSet() const [11]
                0.00 0.03 152762/152762 QSet<QString>::insert(QString const&) [19]
                0.00 0.00 156680/159362 QList<QString>::size() const [93]
                0.00 0.00 152762/153432 QList<QString>::at(int) const [96]
                0.00 0.00 1959/1959 QSet<QString>::reserve(int) [1109]
                0.00 0.00 1959/1961 QSet<QString>::QSet() [2458]
-----------------------------------------------
                0.00 0.00 2/2427252 ColorSetManager::findPalettes(QTreeWidgetItem*) [351]
                0.00 0.00 3/2427252 ScribusQApp::getLang(QString) [363]
                0.00 0.00 5/2427252 IconManager::readIconConfigFiles() [476]
                0.00 0.00 9/2427252 PrefsManager::WritePref(QString const&) [208]
                0.00 0.00 14/2427252 ColorSetManager::findPaletteLocations() [575]
                0.00 0.00 30/2427252 ActionManager::connectModeActions() [1331]
                0.00 0.00 52/2427252 ActionManager::enableActionStringList(QMap<QString, QPointer<ScrAction> >*, QStringList*, bool, bool, QString const&) [1181]
                0.00 0.00 60/2427252 ActionManager::initToolsMenuActions() [384]
                0.00 0.00 104/2427252 ActionManager::initUnicodeActions(QMap<QString, QPointer<ScrAction> >*, QWidget*, QStringList*) [376]
                0.00 0.00 1959/2427252 void qSort<QStringList>(QStringList&) [8]
                0.00 0.00 31696/2427252 UnicodeSearchModel::UnicodeSearchModel(QObject*) [26]
                0.03 0.00 2393318/2427252 void QAlgorithmsPrivate::qSortHelper<QList<QString>::iterator, QString, qLess<QString> >(QList<QString>::iterator, QList<QString>::iterator, QString const&, qLess<QString>) [9]
[12] 16.7 0.03 0.00 2427252 QList<QString>::iterator::operator*() const [12]
                0.00 0.00 2427252/2652218 QList<QString>::Node::t() [2238]
-----------------------------------------------