Lazy load ISourceLinkService to reduce DLL loads#58108
Lazy load ISourceLinkService to reduce DLL loads#58108ryzngard merged 4 commits intodotnet:release/dev17.1from
Conversation
| private readonly ISourceLinkService? _sourceLinkService; | ||
|
|
||
| /// <summary> | ||
| /// Lazy import ISourceLinkService because it can cause debugger |
There was a problem hiding this comment.
it's like we're here to start eachothers...
|
|
||
| var delay = Task.Delay(SourceLinkTimeout, cancellationToken); | ||
| var sourceFileTask = _sourceLinkService.GetSourceFilePathAsync(sourceDocument.SourceLinkUrl, relativePath, logger, cancellationToken); | ||
| var sourceFileTask = _sourceLinkService.Value.GetSourceFilePathAsync(sourceDocument.SourceLinkUrl, relativePath, logger, cancellationToken); |
There was a problem hiding this comment.
Can/should this do a switch to the background thread to ensure the load happens there?
There was a problem hiding this comment.
(although I guess any thread switch should probably be in the implementation since this code doesn't know anything about threads like that...)
There was a problem hiding this comment.
Maybe. I'll leave that for @davidwengier . This is just me doing my best to play whack-a-mole on RPS regressions because of a new DLL load. Thread wouldn't reduce that problem :/
There was a problem hiding this comment.
This is just me doing my best to play whack-a-mole on RPS regressions
And I'm very grateful because I have no idea why the first commit wouldn't have solved the problem ¯\_(ツ)_/¯
jasonmalinowski
left a comment
There was a problem hiding this comment.
, and my question about moving to background thread can be treated as a separate idea.
…rovements * upstream/main: (68 commits) Lazy load ISourceLinkService to reduce DLL loads (dotnet#58108) [main] Update dependencies from dotnet/source-build (dotnet#57707) [main] Update dependencies from dotnet/arcade (dotnet#57968) Factor nullability logic for placeholders (dotnet#58036) Standardize list pattern lowering on `Index` constructor. (dotnet#58055) Add scripts to verify if a branch is ready to review Merge pull request dotnet#58100 from dotnet/dev/jorobich/skip-test Fix some places we weren't correctly disposing of VisualStudioAnalyzers Fix analyzer references being removed and added in one batch Fix indenting Ensure we don't silently capture any exceptions Don't MEF import the implementation directly if the public type will do Change comment Add comment Use actual jump tables Remove unused function Revert Simplify code Compute kind on demand Reorder ...
Validation build https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/367995