[swift-dev] Ongoing work related to compilation performance

Graydon Hoare ghoare at apple.com
Fri Nov 17 13:40:42 CST 2017

>> Improving incremental mode
>> ==========================
>> Another area that could use work is the incremental compilation logic in the driver -- that is, reducing the number of times a file is rebuilt when it "doesn't need to be" -- and some of the documentation and driver-level counters mentioned above provide insight into that (eg.  https://github.com/apple/swift/blob/master/docs/CompilerPerformance.md#driver-diagnosis <https://github.com/apple/swift/blob/master/docs/CompilerPerformance.md#driver-diagnosis>). Incremental compilation is based on approximating the "true" dependency graph and sometimes this approximation is too coarse; but changing this will be a large amount of work, and the nature of a substantial change to that is still subject to a lot of analysis and design. In the meantime there may also simpler bugs lurking in the dependency-analysis logic, within the current dependency approximation; I'd be happy to help anyone who wants to spend time bug-hunting in this area understand what they're looking at.
> Has any thought been put into taking advantage of llbuild for dependency graphs? Can some performance improvements come from that?

Long term I think there's general interest for leveraging it, in place of the miniature build system inside the swift driver; but the discovery/analysis or dependencies and the scheduling/executing of jobs are somewhat separate tasks, and llbuild only does the second. The mapping from a set of swift declarations-and-files into a dependency graph that is a safe (but tight) approximation of the "true" dependencies of the compiler is the hard part. That is, the material that goes into a .swiftdeps file is the hard part; and unfortunately that's a thing build systems delegate to compilers to figure out, since it involves tracing the compiler's internal activities, as it runs each job.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20171117/156577d8/attachment.html>

More information about the swift-dev mailing list