diff --git a/lib/IDE/CompletionInstance.cpp b/lib/IDE/CompletionInstance.cpp index 632a3b5f6542a..44dbf98a3fadd 100644 --- a/lib/IDE/CompletionInstance.cpp +++ b/lib/IDE/CompletionInstance.cpp @@ -324,6 +324,11 @@ bool swift::ide::CompletionInstance::performOperation( // source text. That breaks an invariant of syntax tree building. Invocation.getLangOptions().BuildSyntaxTree = false; + // This validation may call stat(2) many times. Disable it to prevent + // performance regression. + Invocation.getSearchPathOptions().DisableModulesValidateSystemDependencies = + true; + // FIXME: ASTScopeLookup doesn't support code completion yet. Invocation.disableASTScopeLookup();