Skip to content

[Caching] Don't rely on FileSystem when replaying diagnostics #73822

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
Jun 3, 2024

Conversation

cachemeifyoucan
Copy link
Contributor

Stop relying on file system to provide source buffer for diagnostics when replying. This avoids initializing CASFS which is quite expensive. Now cached diagnostics contains CASID for the file buffer so it can initialize its own source manager without relying on the underlying file system.

rdar://128423393

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test linux platform

@cachemeifyoucan
Copy link
Contributor Author

ping

if (Input.getFileName() != "-")
SrcMgr.getExternalSourceBufferID(remapFilePath(Input.getFileName()));
auto Path = remapFilePath(Input.getFileName());
SrcMgr.getExternalSourceBufferID(Path);
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicated with next line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are two different SourceMgr. The first one is the one used to replay, and the second one is the actual SourceMgr from the instance.

Copy link
Contributor

Choose a reason for hiding this comment

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

This deserves a comment or else rename SM so it's clear the difference

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

if (Input.getFileName() != "-")
SrcMgr.getExternalSourceBufferID(remapFilePath(Input.getFileName()));
auto Path = remapFilePath(Input.getFileName());
SrcMgr.getExternalSourceBufferID(Path);
Copy link
Contributor

Choose a reason for hiding this comment

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

This deserves a comment or else rename SM so it's clear the difference

Stop relying on file system to provide source buffer for diagnostics
when replying. This avoids initializing CASFS which is quite expensive.
Now cached diagnostics contains CASID for the file buffer so it can
initialize its own source manager without relying on the underlying file
system.

rdar://128423393
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test linux platform

@cachemeifyoucan cachemeifyoucan merged commit 81c0636 into swiftlang:main Jun 3, 2024
3 checks passed
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.

2 participants