Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Commit 49b0bbf

Browse files
author
Frerich Raabe
committed
Optimized creating manifests
When creating manifests, we would first compute the list of included files, then commpute the hash code of their contents and then call ManifestRepository.getIncludesContentHashForFiles(). That function would then re-compute the file hash for each file to see whether it's still the same, but there's no point in doing so since we just computed the hash!
1 parent 6e5596a commit 49b0bbf

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

clcache.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ def verifyIncludesHashes(includes):
208208

209209
@staticmethod
210210
def getIncludesContentHashForFiles(includes):
211-
ManifestRepository.verifyIncludesHashes(includes)
212211
return ManifestRepository.getIncludesContentHashForHashes(sorted(includes.values()))
213212

214213
@staticmethod
@@ -1515,10 +1514,12 @@ def processDirect(cache, objectFile, compiler, cmdLine, sourceFile):
15151514
if manifest is not None:
15161515
# NOTE: command line options already included in hash for manifest name
15171516
try:
1518-
includesContentHash = ManifestRepository.getIncludesContentHashForFiles({
1517+
includes = {
15191518
expandBasedirPlaceholder(path, baseDir):contentHash
15201519
for path, contentHash in manifest.includeFiles.items()
1521-
})
1520+
}
1521+
ManifestRepository.verifyIncludesHashes(includes)
1522+
includesContentHash = ManifestRepository.getIncludesContentHashForFiles(includes)
15221523

15231524
cachekey = manifest.includesContentToObjectMap.get(includesContentHash)
15241525
assert cachekey is not None

0 commit comments

Comments
 (0)