Cleanup unnecessary thread affinity in the Visual Studio logging codepath #3295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: NuGet/Home#9288
Regression: Yes/No
Fix
Details:
Clean up unnecessary thread affinity in the Visual Studio logging code path.
By async-ifying everything, we can remove the need to have so many affinitized methods and with that spent less time on the UI thread and only when absolutely necessary.
It'd be difficult to get a measurable improvement out of these changes, and they often times won't cause a UI delay but general sluggishness.
This change will especially improve thing in the low verbosity cases where we frequently might have ended up on the UI thread with no real business to do there.
Testing/Validation
Tests Added: No
Reason for not adding tests: Thread affinity changes, I expect the end to end tests and manual tests to capture issues.
Validation: Manual + waiting for automation.
Draft
Leaving this as draft until I do some more complete manual tests and see all the tests passing.