-
Notifications
You must be signed in to change notification settings - Fork 216
[Incremental] Fix clean build quadratic performance bug #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Incremental] Fix clean build quadratic performance bug #750
Conversation
|
This PR is my preferred fix for the issue addressed in #742 |
|
@swift-ci please test |
Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraphParts/DependencySource.swift
Outdated
Show resolved
Hide resolved
cltnschlosser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not super familiar with it all, but most of it makes sense to me now.
Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraph.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraph.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraph.swift
Outdated
Show resolved
Hide resolved
|
@swift-ci please test |
86e4305 to
a7030d7
Compare
|
@swift-ci please test |
|
@cltnschlosser @artemcm @CodaFi , I think this is now ready for a review. Would you care to take a look? It should fix the clean build regression issue in a principled fashion. |
|
@swift-ci please test |
CodaFi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. For 5.5, we could take just the currency cache it seems.
| /// Try to read and integrate an external dependency. | ||
| /// Return nil if it's not incremental, or if an error occurs. | ||
| /// | ||
| /// Return: nil if an error occurs, or the set of directly affected nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
/// - Returns:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed.
| /// Compute the reason for (non-incrementally) invalidating nodes | ||
| /// | ||
| /// Parameter integrand: The exernal dependency causing the invalidation | ||
| /// Returns: nil if no invalidation is needed, otherwise the reason. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed!
| // in a as-yet-unread swiftdeps file. | ||
| // | ||
| // Instead, just compile everything. It's OK to be unsound then because every file will be compiled anyway. | ||
| return bulidEmptyGraphAndCompileEverything() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed!
|
@swift-ci please test |
|
@CodaFi Thank you for your prompt review. Let's talk offline about Swift 5.5, I want to get your thoughts on that. |
The status quo reads every
swiftmodulefile for every input file. This PR fixes that. It is trickier than it seems because, when incremental imports are disabled, every time an initialswiftdepsfile is processed, invalidation must happen for every (changed)swiftmodulereferenced. So, this fix involves a larger reorganization that it would seem at first blush.I've tried to include enough comments, etc., so that this code should be understandable.