-
Notifications
You must be signed in to change notification settings - Fork 156
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
More performance tweaks adaptive #1028
More performance tweaks adaptive #1028
Conversation
TheAngryByrd
commented
Oct 16, 2022
- Incremental text changes + fixes
- Completion Speed ups
- Clear caches on project changes
- Slightly more resilient around getting typechecks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This work is based onhttps://github.com//pull/1025 so might want to consider that one first
@@ -50,6 +50,7 @@ nuget YoloDev.Expecto.TestSdk | |||
nuget AltCover | |||
nuget GitHubActionsTestLogger | |||
nuget Ionide.LanguageServerProtocol | |||
nuget Microsoft.Extensions.Caching.Memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use stale results for completions to get it to be super quick. However the compiler's TryGetRecentTypeCheck only keeps type checks for the specific sourcetext, which won't really matter for us because we'll be doing incremental type checking on DidChange already
@@ -227,14 +235,23 @@ type FSharpCompilerServiceChecker(hasAnalyzers) = | |||
member __.ScriptTypecheckRequirementsChanged = | |||
scriptTypecheckRequirementsChanged.Publish | |||
|
|||
/// This function is called when the entire environment is known to have changed for reasons not encoded in the ProjectOptions of any project/compilation. | |||
member _.ClearCaches() = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful for major project changes like git checkout
let ops = | ||
MemoryCacheEntryOptions() | ||
.SetSize(1) | ||
.SetSlidingExpiration(TimeSpan.FromMinutes(2.)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if a time is really needed.
|
||
GC.Collect() | ||
GC.WaitForPendingFinalizers() | ||
Async.Start( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving things to Async calls to allow type checks to come back faster. Not as strictly necessary anymore given our new method of completions.
@@ -930,16 +1064,28 @@ type AdaptiveFSharpLspServer(workspaceLoader: IWorkspaceLoader, lspClient: FShar | |||
|> Result.ofOption (fun () -> $"No parse results for {filePath}") | |||
|
|||
let forceGetTypeCheckResults filePath = | |||
let tyResults = getTypeCheckResults (filePath) | |||
let rec doIt tryAgain = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't get type check results for a file, assume we need to mark it out of date and try again.
This will be an issue with bigger projects but this needs discussion how it should work
1ca08b2
to
cdd7299
Compare
Closing in favor of #1036 |