Skip to content

Improve performance of sourceFilesAndDirectories #1865

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

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Dec 6, 2024

SourceFilesAndDirectoriesKey contained all source files in the project and computing its hash value was pretty expensive. The key didn’t really provide any value here because the only way it changes is if the build targets change and if that’s the case, we already clear cachedSourceFilesAndDirectories, so we can just avoid the hash value computation.

@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2024

@swift-ci Please test

@ahoppen ahoppen force-pushed the source-files-performance branch from f406b57 to 1388193 Compare December 6, 2024 17:12
@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2024

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2024

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the source-files-performance branch from 1388193 to 39dce40 Compare December 6, 2024 19:52
@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2024

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the source-files-performance branch from 39dce40 to c58938b Compare December 7, 2024 17:27
@ahoppen
Copy link
Member Author

ahoppen commented Dec 7, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Dec 9, 2024

@swift-ci Please test Windows

`SourceFilesAndDirectoriesKey` contained all source files in the project and computing its hash value was pretty expensive. The key didn’t really provide any value here because the only way it changes is if the build targets change and if that’s the case, we already clear `cachedSourceFilesAndDirectories`, so we can just avoid the hash value computation.
@ahoppen ahoppen force-pushed the source-files-performance branch from c58938b to 559f239 Compare December 11, 2024 00:26
@ahoppen
Copy link
Member Author

ahoppen commented Dec 11, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Dec 11, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit ec461d6 into swiftlang:main Dec 11, 2024
3 checks passed
@ahoppen ahoppen deleted the source-files-performance branch December 11, 2024 18:06
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