diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2016-12-22 13:40:19 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2016-12-22 17:10:47 +0000 |
commit | 5a8d76c2f6006ff70bcc78853dbe95b6465851a8 (patch) | |
tree | 1f57894437450c7b81682e49d028f0b6f81da597 /src/lib/corelib/buildgraph/inputartifactscanner.cpp | |
parent | 519d065e008e75589f6ce440d840f4114c22b275 (diff) |
Do not remove artifacts from the scan result cache
Presumably, this code was to ensure that only finished artifacts would
be retrieved from the cache. However, we can simply make sure that sure
unbuilt artifacts do not end up there in the first place.
Benchmarker output is below. Real-world numbers: When building the Qt
Creator super project, the total number of scanned header files goes
down from 24966 to 17889.
========== Performance data for Rule Execution ==========
Old instruction count: 3560941434
New instruction count: 3399056106
Relative change: -5 %
Old peak memory usage: 17590920 Bytes
New peak memory usage: 17668328 Bytes
Relative change: +0 %
Task-number: QBS-1052
Change-Id: Ic76f9d5f2e74fa694d5584ad3f4f2edf5d5b136d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/inputartifactscanner.cpp')
-rw-r--r-- | src/lib/corelib/buildgraph/inputartifactscanner.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp index cdf38b247..a505d3b21 100644 --- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp +++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp @@ -290,10 +290,11 @@ resolved: handleDependency(resolvedDependency); if (artifactsToScan && resolvedDependency.file) { if (Artifact *artifactDependency = dynamic_cast<Artifact *>(resolvedDependency.file)) { - // Do not scan artifacts that are being built. Otherwise we might read an incomplete - // file or conflict with the writing process. - if (artifactDependency->buildState != BuildGraphNode::Building) + // Do not scan an artifact that is not built yet: Its contents might still change. + if (artifactDependency->artifactType == Artifact::SourceFile + || artifactDependency->buildState == BuildGraphNode::Built) { artifactsToScan->append(artifactDependency); + } } else { // Add file dependency to the next round of scanning. artifactsToScan->append(resolvedDependency.file); |