diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-18 18:15:35 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-18 18:15:35 -0500 |
| commit | d41d57fe07633cc1be70c666e91c7e571afdd28f (patch) | |
| tree | bc84402369d6a1920a7d21349de7233fe21b8531 | |
| parent | e749b2072601830c11495ce210907391dfe7bc6b (diff) | |
| parent | f9ad6d97098093b5d03e7792798583ea73a1ea65 (diff) | |
Merge pull request #1004 from isanae/timings
More timings
| -rw-r--r-- | src/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/directoryrefresher.cpp | 6 | ||||
| -rw-r--r-- | src/downloadmanager.cpp | 4 | ||||
| -rw-r--r-- | src/main.cpp | 12 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 10 | ||||
| -rw-r--r-- | src/modinfo.cpp | 2 | ||||
| -rw-r--r-- | src/organizercore.cpp | 5 | ||||
| -rw-r--r-- | src/plugincontainer.cpp | 2 | ||||
| -rw-r--r-- | src/pluginlist.cpp | 2 |
9 files changed, 34 insertions, 11 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85d8af0f..d1430963 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -293,6 +293,7 @@ SET(organizer_HDRS shared/fileentry.h shared/filesorigin.h shared/fileregister.h + shared/fileregisterfwd.h shared/originconnection.h shared/util.h shared/appconfig.h @@ -481,6 +482,7 @@ set(register shared/fileentry shared/filesorigin shared/fileregister + shared/fileregisterfwd shared/originconnection directoryrefresher ) diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp index e8c26c90..57948236 100644 --- a/src/directoryrefresher.cpp +++ b/src/directoryrefresher.cpp @@ -286,7 +286,7 @@ void DirectoryRefresher::addModFilesToStructure( DirectoryEntry *directoryStructure, const QString &modName,
int priority, const QString &directory, const QStringList &stealFiles)
{
- TimeThis tt("addModFilesToStructure()");
+ TimeThis tt("DirectoryRefresher::addModFilesToStructure()");
std::wstring directoryW = ToWString(QDir::toNativeSeparators(directory));
DirectoryStats dummy;
@@ -307,7 +307,7 @@ void DirectoryRefresher::addModToStructure(DirectoryEntry *directoryStructure , const QStringList &stealFiles
, const QStringList &archives)
{
- TimeThis tt("addModToStructure()");
+ TimeThis tt("DirectoryRefresher::addModToStructure()");
DirectoryStats dummy;
@@ -463,7 +463,7 @@ void DirectoryRefresher::addMultipleModsFilesToStructure( void DirectoryRefresher::refresh()
{
SetThisThreadName("DirectoryRefresher");
- TimeThis tt("refresh");
+ TimeThis tt("DirectoryRefresher::refresh()");
auto* p = new DirectoryRefreshProgress(this);
{
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index a93182b4..4defd96b 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -320,6 +320,8 @@ void DownloadManager::setPluginContainer(PluginContainer *pluginContainer) void DownloadManager::refreshList() { + TimeThis tt("DownloadManager::refreshList()"); + try { //avoid triggering other refreshes startDisableDirWatcher(); @@ -1873,7 +1875,7 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use //Unable to determine the correct mod / file. Revert to the old method if (chosenIdx < 0) { //don't use the normal state set function as we don't want to create a meta file - info->m_State = DownloadManager::STATE_READY; + info->m_State = DownloadManager::STATE_READY; queryInfo(m_ActiveDownloads.indexOf(info)); return; } diff --git a/src/main.cpp b/src/main.cpp index 105299a8..8813aaa7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -506,6 +506,8 @@ static QString getVersionDisplayString() int runApplication(MOApplication &application, SingleInstance &instance, const QString &splashPath) { + TimeThis tt("runApplication() to exec()"); + log::info( "starting Mod Organizer version {} revision {} in {}, usvfs: {}", getVersionDisplayString(), GITID, QCoreApplication::applicationDirPath(), @@ -703,7 +705,7 @@ int runApplication(MOApplication &application, SingleInstance &instance, } QPixmap pixmap; - + QSplashScreen splash(nullptr); if (useSplash) { @@ -748,13 +750,15 @@ int runApplication(MOApplication &application, SingleInstance &instance, log::debug("displaying main window"); mainWindow.show(); mainWindow.activateWindow(); - + if (useSplash) { // don't pass mainwindow as it just waits half a second for it // instead of proceding splash.finish(nullptr); } + tt.stop(); + res = application.exec(); mainWindow.close(); @@ -855,6 +859,8 @@ void initLogging() int main(int argc, char *argv[]) { + TimeThis tt("main to runApplication()"); + // handle --crashdump first for (int i=1; i<argc; ++i) { if (std::strcmp(argv[i], "--crashdump") == 0) { @@ -954,6 +960,8 @@ int main(int argc, char *argv[]) splash = ":/MO/gui/splash"; } + tt.stop(); + const int result = runApplication(application, instance, splash); if (result != RestartExitCode) { return result; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 21a6fa41..325a7e93 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -962,6 +962,8 @@ void MainWindow::scheduleUpdateButton() void MainWindow::updateProblemsButton() { + TimeThis tt("MainWindow::updateProblemsButton()"); + // if the current stylesheet doesn't provide an icon, this is used instead const char* DefaultIconName = ":/MO/gui/warning"; @@ -1667,9 +1669,9 @@ void MainWindow::on_profileBox_currentIndexChanged(int index) // Avoid doing any refresh if currentProfile is already set but previous index was -1 // as it means that this is happening during initialization so everything has already been set. - if (previousIndex == -1 - && m_OrganizerCore.currentProfile() != nullptr - && m_OrganizerCore.currentProfile()->exists() + if (previousIndex == -1 + && m_OrganizerCore.currentProfile() != nullptr + && m_OrganizerCore.currentProfile()->exists() && ui->profileBox->currentText() == m_OrganizerCore.currentProfile()->name()){ return; } @@ -5517,7 +5519,7 @@ void MainWindow::nxmUpdatesAvailable(QString gameName, int modID, QVariant userD bool foundUpdate = false; bool oldFile = false; QString installedFile = mod->getInstallationFile(); - if (!installedFile.isEmpty()) { + if (!installedFile.isEmpty()) { QVariantMap foundFile; for (auto file : files) { QVariantMap fileData = file.toMap(); diff --git a/src/modinfo.cpp b/src/modinfo.cpp index d971f150..71a4a386 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -251,6 +251,8 @@ void ModInfo::updateFromDisc(const QString &modDirectory, bool displayForeign, MOBase::IPluginGame const *game) { + TimeThis tt("ModInfo::updateFromDisc()"); + QMutexLocker lock(&s_Mutex); s_Collection.clear(); s_NextID = 0; diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 80df044a..0b3a4bfe 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1127,6 +1127,8 @@ void OrganizerCore::refreshESPList(bool force) void OrganizerCore::refreshBSAList() { + TimeThis tt("OrganizerCore::refreshBSAList()"); + DataArchives *archives = m_GamePlugin->feature<DataArchives>(); if (archives != nullptr) { @@ -1408,7 +1410,8 @@ void OrganizerCore::refreshDirectoryStructure() void OrganizerCore::directory_refreshed() { - log::debug("structure refreshed"); + log::debug("directory refreshed, finishing up"); + TimeThis tt("OrganizerCore::directory_refreshed()"); DirectoryEntry *newStructure = m_DirectoryRefresher->stealDirectoryStructure(); Q_ASSERT(newStructure != m_DirectoryStructure); diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index 767d3eb8..3227f496 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -249,6 +249,8 @@ const PreviewGenerator &PluginContainer::previewGenerator() const void PluginContainer::loadPlugins()
{
+ TimeThis tt("PluginContainer::loadPlugins()");
+
unloadPlugins();
for (QObject *plugin : QPluginLoader::staticInstances()) {
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 4b2eedbd..d58b1c22 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -174,6 +174,8 @@ void PluginList::refresh(const QString &profileName , const QString &lockedOrderFile
, bool force)
{
+ TimeThis tt("PluginList::refresh()");
+
if (force) {
m_ESPs.clear();
m_ESPsByName.clear();
|
