Skip to content

[Caching] Skip cache key computation for unbatched compile jobs - #2227

Merged
cachemeifyoucan merged 2 commits into
swiftlang:mainfrom
cachemeifyoucan:eng/PR-188865845
Oct 8, 2026
Merged

cachemeifyoucan merged 2 commits into
swiftlang:mainfrom
cachemeifyoucan:eng/PR-188865845

Conversation

@cachemeifyoucan

Copy link
Copy Markdown
Contributor

compileJob ignored its produceCacheKey parameter and always computed
output cache keys. In batch mode, the per-file compile jobs are later
re-formed into batch jobs that compute their own keys, so the keys for
the unbatched jobs were wasted work. With incremental builds, the jobs
for skipped files are never batched, so every build computed and stored
a cache key for every file in the module.

Honor produceCacheKey so only the jobs that will run get cache keys.

rdar://188865845

`compileJob` ignored its `produceCacheKey` parameter and always computed
output cache keys. In batch mode, the per-file compile jobs are later
re-formed into batch jobs that compute their own keys, so the keys for
the unbatched jobs were wasted work. With incremental builds, the jobs
for skipped files are never batched, so every build computed and stored
a cache key for every file in the module.

Honor `produceCacheKey` so only the jobs that will run get cache keys.

rdar://188865845
@cachemeifyoucan

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@cachemeifyoucan

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows platform

1 similar comment
@cachemeifyoucan

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows platform

The test doesn't need the stdlib or the SDK. Build with -parse-stdlib to
make it run much faster.
@cachemeifyoucan

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@cachemeifyoucan

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows platform

@cachemeifyoucan
cachemeifyoucan merged commit aeaa968 into swiftlang:main Oct 8, 2026
71 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants