Skip to content
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

Restore: improve thread pool starvation fix by disabling asynchronous I/O #2488

Merged
merged 1 commit into from
Oct 22, 2018

Conversation

dtivel
Copy link
Contributor

@dtivel dtivel commented Oct 19, 2018

Resolve NuGet/Home#7314.

The fix is to disable asynchronous I/O in the FileSystem class.

Ignoring the previous change, this change improves restore performance under .NET Core 2.1+ by ~70% using .NET Core 2.2 Preview 3 (2.2.100-preview3-009430) and the repro for https://github.com/dotnet/corefx/issues/31914.

Trial Baseline (seconds) With useAsync == false (seconds)
1 293.6 66.99
2 280.06 65.87
3 276.75 73.42
4 273.04 81.44
5 287.19 102.84
6 269.03 72.28
7 288.72 100.19
8 298.51 109.87
9 275.34 78.8
10 268.6 84.41
Average 281.084 83.611

All baseline trials ultimately failed with:

The SSL connection could not be established, see inner exception.
Authentication failed because the remote party has closed the transport stream.

None of the trials with the fix failed.

This fix was intended for .NET Core 2.1+ as its HTTP rewrite was the catalyst for this performance regression. However, I tested the same fix with NuGet.exe and found a ~44% improvement in restore performance.

Trial Baseline (seconds) With useAsync == false (seconds)
1 85.8 47.2
2 78.0 42.2
3 84.0 45.5
4 88.2 45.5
5 96.0 49.6
6 89.4 66.0
7 96.0 45.4
8 81.6 47.1
9 84.0 45.6
10 82.2 47.7
Average 86.5 48.2

Copy link
Contributor

@jainaashish jainaashish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@loic-sharma
Copy link
Contributor

loic-sharma commented Oct 22, 2018

However, I tested the same fix with NuGet.exe and found a ~44% improvement in restore performance.

Do we know why removing async improves performance here? Is this also due to the HTTP rewrite you mentioned?

@dtivel
Copy link
Contributor Author

dtivel commented Oct 22, 2018

@loic-sharma, yes, we do.

See https://github.com/dotnet/corefx/issues/31914 and https://github.com/dotnet/corefx/issues/32837.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restore: performance regression using new .NET Core 2.1 HTTP stack
4 participants