Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Nov 9, 2020

This will allow individual module scans in batch-scanning mode to share the already-scanned Swift and Clang module dependencies, and avoid instantiating a new Clang DependencyScanningService for each batch entry.

Performance-improvement anecdote:
A simple experiment was carried out which performs a batch scan of all modules involved in planning a build of SwiftPM. The input batch includes 126 entries (scan entry-points), with 21 distinct Swift modules and 27 distinct Clang modules (many Clang modules are scanned multiple times, at different target versions). For this experiment, this modification reduces the total time taken from ~34 seconds to ~6.

@artemcm
Copy link
Contributor Author

artemcm commented Nov 9, 2020

@swift-ci please test

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b1054a57d0e8ae03141018d3a9176dd2155b1eb3

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b1054a57d0e8ae03141018d3a9176dd2155b1eb3

… CompilerInstance

This will allow individual module scans in batch-scanning mode to share the already-scanned Swift and Clang modules, and avoid instantiating a brand new Clang `DependencyScanningService` for each batch entry.

Performance-improvement anecdote:
A simple experiment which performs a batch scan of all modules involved in planning a build of SwiftPM (using SwiftPM in explicit module build mode), which includes 126 batch entries (scan entry-points), with 21 distinct Swift modules and 27 distinct Clang modules (many Clang modules are scanned multiple times, at different target versions), this modification reduces the total time taken from ~34 seconds to ~6.
@artemcm artemcm force-pushed the BatchScanShouldShareCache branch from b1054a5 to 10b6b9d Compare November 10, 2020 17:26
@artemcm
Copy link
Contributor Author

artemcm commented Nov 10, 2020

@swift-ci please test

@artemcm
Copy link
Contributor Author

artemcm commented Nov 10, 2020

@swift-ci please test Windows platform

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Nov 10, 2020

@swift-ci please test Windows platform

@artemcm artemcm merged commit 3e3be76 into swiftlang:main Nov 10, 2020
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.

3 participants