| Issue |
242213
|
| Summary |
[clang][deps] The scanner's strict context hash builds the SDK's modules once per distinct search list
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
Dharin-shah
|
Hmm, I think the dependency scanner's implicit module cache gets split far more than its modules need. `DependencyScanningWorker` sets `ModulesStrictContextHash = true` for the scan, with the TODO about diagnostic bucketing next to it, so every distinct list of header search entries gets its own context directory. That holds even when none of the entries can change what an SDK module resolves to.
Two numbers from Xcode 27.2's scanner on an M5 Pro:
- A React Native 0.87.1 app with 114 CocoaPods targets: one cold build left 130 contexts and 5,524 scanning PCMs, 469 MiB, in its module cache. `_DarwinFoundation1` was built 130 times. Its language and target options are the same in all but 17 of those contexts, so the rest differ only in what the strict hash adds: each target's own header search entries, macros and warnings.
- A pure Swift app of 136 targets: 136 contexts and 3,703 scanning PCMs. With each target's own name replaced, the 136 search lists are identical: 11 entries, of which the per-target ones are three DerivedSources folders and four header maps.
In a new DerivedData every one of those is rebuilt, and on the React Native app that is most of the Objective-C scans' cost. Keeping the module cache cut them from 92.8 to 24.2 s of task time.
Would hashing only the search entries a module's lookups actually used (the scanner already knows which, as it prunes unused ones from the explicit commands) be possible here? Or is `-fmodules-ignore-search-path=` (#217061) the intended way, with the build system naming the entries? Happy to measure a patch on these two apps 🙂
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs