Skip to content

cache results of fileExists check in default compiler host #5367

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 3 commits into from
Oct 23, 2015

Conversation

vladima
Copy link
Contributor

@vladima vladima commented Oct 22, 2015

No description provided.

@RyanCavanaugh
Copy link
Member

Isn't this a problem for tsc -w ?

@vladima
Copy link
Contributor Author

vladima commented Oct 22, 2015

it might. Also we currently already cache results of directoryExists check which is also incorrect

@RyanCavanaugh
Copy link
Member

directoryExists does the right thing for that scenario, though -- it only catches true results

@vladima
Copy link
Contributor Author

vladima commented Oct 22, 2015

directory can be deleted between recompilations and we still will think it exists

@DanielRosenwasser
Copy link
Member

You could also make a helper function for sys.fileExists that performs its own caching in non-watch scenarios.

@@ -286,6 +295,13 @@ namespace ts {
reportWatchDiagnostic(createCompilerDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes));
}

function fileExists(fileName: string): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we rename this to cachedFileExist just to make it clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@mhegazy
Copy link
Contributor

mhegazy commented Oct 23, 2015

👍

vladima added a commit that referenced this pull request Oct 23, 2015
cache results of fileExists check in default compiler host
@vladima vladima merged commit 69986a1 into master Oct 23, 2015
@vladima vladima deleted the cacheFileExists branch October 23, 2015 20:27
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants