Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Set spin count to 1 in ManualResetEventSlim #1830
This PR fixes performance issues seen after introducing this commit which was hoping that the issues seen earlier with
The same high CPU usage symptoms were seen earlier in this commit and the workaround was to use
After experimentation, setting the spinCount to 1 drops the CPU usage to 0-5% and write speeds increase by approximately 50% (atleast on my laptop).
It seems that default spin count of 10 used by mono was too high, causing excess spinning (this was manually verified by setting the spin count to 10):