diff options
author | Christian Kandeler <[email protected]> | 2020-01-31 15:52:20 +0100 |
---|---|---|
committer | Christian Kandeler <[email protected]> | 2020-02-03 16:07:54 +0000 |
commit | c7d8b9b01c140a44abf2c93a4354ac0f66a68590 (patch) | |
tree | 290d0cf862bb964d375a2f1b386bba9849ee46cb /src/plugins/qmakeprojectmanager/qmakeparsernodes.h | |
parent | 38904735002877c5647ba57d259fb0f2d34ff16d (diff) |
QMakeProjectManager: Move some parsing code out of the UI thread
When parsing larger qmake project, the callbacks from the parser threads
are currently overloading the UI thread, often rendering the application
non-responsive until the project is completely loaded.
This patch moves some expensive operations from the UI thread into the
parser threads, at the cost of a somewhat ugly two-stage setup for some
types of objects.
On my Linux machine, I measured that the time spent in parser callback code
went down by almost 50% when loading the Qt Creator super project.
Task-number: QTCREATORBUG-18533
Change-Id: If9624da5b07e81a50c180693580b20a70e1aaea7
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/qmakeprojectmanager/qmakeparsernodes.h')
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakeparsernodes.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h index 61620e59fcf..9a5977348af 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h @@ -125,8 +125,10 @@ class QMAKEPROJECTMANAGER_EXPORT QmakePriFile { public: QmakePriFile(QmakeBuildSystem *buildSystem, QmakeProFile *qmakeProFile, const Utils::FilePath &filePath); + explicit QmakePriFile(const Utils::FilePath &filePath); virtual ~QmakePriFile(); + void finishInitialization(QmakeBuildSystem *buildSystem, QmakeProFile *qmakeProFile); Utils::FilePath filePath() const; Utils::FilePath directoryPath() const; virtual QString displayName() const; @@ -241,6 +243,7 @@ private: QMap<ProjectExplorer::FileType, SourceFiles> m_files; QSet<Utils::FilePath> m_recursiveEnumerateFiles; // FIXME: Remove this?! QSet<QString> m_watchedFolders; + const Utils::FilePath m_filePath; bool m_includedInExactParse = true; friend class QmakeProFile; @@ -294,8 +297,11 @@ class QMAKEPROJECTMANAGER_EXPORT QmakeProFile : public QmakePriFile { public: QmakeProFile(QmakeBuildSystem *buildSystem, const Utils::FilePath &filePath); + explicit QmakeProFile(const Utils::FilePath &filePath); ~QmakeProFile() override; + void setupFutureWatcher(); + bool isParent(QmakeProFile *node); QString displayName() const final; @@ -390,7 +396,7 @@ private: QMap<QString, QStringList> m_wildcardDirectoryContents; // Async stuff - QFutureWatcher<Internal::QmakeEvalResult *> m_parseFutureWatcher; + QFutureWatcher<Internal::QmakeEvalResult *> *m_parseFutureWatcher = nullptr; QtSupport::ProFileReader *m_readerExact = nullptr; QtSupport::ProFileReader *m_readerCumulative = nullptr; }; |