You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use AutoResetEvent as oppose to ManualResetEventSlim (#8575)
Summary
Customer, mainly internal like XStore, with huge repos, using msbuild /graph /bl on powerful development and build computers, might experience 15x plus regression in evaluation time.
It has been identified as performance bug in our logging event pub/sub mechanism. When ingest queue reaches its bound, at .net472 ManualResetEventSlim causes way too many thread.Yields flooding the system with thread context switches.
This hypothesis has been verified by PerfMon perfcounter System.ContextSwitches.
Alhougt counterintuitive, AutoResetEvent , ManualResetEvent or even SpinLocking produced better behavior and with those the issue no longer reproduce.
Customer Impact
In case of XStore it was about 7 minutes in build time.
Regression?
Yes, introduced in VS 17.4.
Testing
Manual validation by @rokonec and automated tests. Using local repro to verify changes has fixed it.
Risk
Low
Note
It effect only VS MSBuild.exe. In dotnet build ManualResetEventSlim works better.
Copy file name to clipboardExpand all lines: eng/Versions.props
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
0 commit comments