diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2016-10-05 17:55:55 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2016-10-25 11:57:55 +0000 |
commit | 9cd8653eef26acdec85c33c350ae47291b99a9b5 (patch) | |
tree | c060b8b7e6afc6f15eba4303271e67cf8d33d36e /src/lib/corelib/language/evaluator.h | |
parent | d07c24c701963ac0eaf1e7fb1774efcf2ee4dee3 (diff) |
Do not needlessly re-evaluate module properties in Groups
For a Group that contains at least one module property assignment, we
used to re-evaluate all module properties. This was of course immensely
wasteful, as there are normally only a handful of properties in need of
re-evaluation.
We fix the problem in the following way:
- When evaluating a product's module properties, keep track of
the dependencies between them.
- For all Groups of that product, re-evaluate only the properties
which are either explicitly set in that group or have a dependency
on such a property.
Here's the output of qbs_benchmarker, using qbs itself as the test
project:
========== Performance data for Resolving ==========
Old instruction count: 2083482809
New instruction count: 1696643887
Relative change: -19 %
Old peak memory usage: 2997349 Bytes
New peak memory usage: 2704033 Bytes
Relative change: -10 %
I've also profiled with the Qt Creator super project (not using
valgrind, as that would take ages). For that project, this change halves
the time spent in the ProjectResolver, while the overall resolving time
goes down by about a third.
Note that we could potentially use the gathered dependency data in
change tracking as well, provided we manage to find out what exactly
changed in the project files. That should result in an improved
experience for IDE users.
Change-Id: I6ceffe7a6f0421617f53a4dd2eade51993c2785f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/language/evaluator.h')
-rw-r--r-- | src/lib/corelib/language/evaluator.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/corelib/language/evaluator.h b/src/lib/corelib/language/evaluator.h index 49262d8a5..3701935d3 100644 --- a/src/lib/corelib/language/evaluator.h +++ b/src/lib/corelib/language/evaluator.h @@ -42,6 +42,7 @@ #include "forward_decls.h" #include "itemobserver.h" +#include "qualifiedid.h" #include <QHash> #include <QScriptValue> @@ -77,6 +78,9 @@ public: void setCachingEnabled(bool enabled); + PropertyDependencies propertyDependencies() const; + void clearPropertyDependencies(); + void handleEvaluationError(const Item *item, const QString &name, const QScriptValue &scriptValue); private: |