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

SocketSender/Receiver: also Inline continuations on Windows #19394

Closed
wants to merge 1 commit into from

Conversation

tmds
Copy link
Member

@tmds tmds commented Feb 27, 2020

Some benchmarks we ran on Linux indicate this may be interesting on Windows.

cc @halter73 @davidfowl @sebastienros @adamsitnik

@analogrelay
Copy link
Contributor

Triage: we do have some hunch that there's a reason we didn't inline continuations on Windows. @davidfowl @halter73 does that ring a bell?

@davidfowl
Copy link
Member

@halter73 wrote up the reason we use IOQueues here dotnet/runtime#2346 (comment).

@tmds
Copy link
Member Author

tmds commented Mar 2, 2020

In theory, Inline should be faster than IOQueue, and IOQueue should be faster than ThreadPool.
In practice, it doesn't seem to always work that way.
So let's measure and see the effect.

@tmds
Copy link
Member Author

tmds commented Mar 6, 2020

Can we run a benchmark to see the effect?

@shirhatti
Copy link
Contributor

Triage: We've tried this before, and it didn't end well aspnet/KestrelHttpServer#2573

@shirhatti shirhatti closed this Apr 10, 2020
@tmds
Copy link
Member Author

tmds commented Apr 10, 2020

Triage: We've tried this before, and it didn't end well aspnet/KestrelHttpServer#2573

@shirhatti that issue says it didn't end well on Linux.

@shirhatti
Copy link
Contributor

Ah shoot @halter73?

@shirhatti shirhatti reopened this Apr 10, 2020
@tmds
Copy link
Member Author

tmds commented Apr 10, 2020

@halter73 if you know it is faster to use IoQueue here on Windows, I'm fine if the issue gets closed. Otherwise we can run a benchmark and find out.

@halter73
Copy link
Member

halter73 commented Apr 10, 2020

For SocketReceiver at least, dispatching receive continuations on Windows, even to the threadpool significantly improved perf in the plaintext and json benchmarks. @davidfowl first proved that with aspnet/KestrelHttpServer#2366.

Dispatching to the IOQueue which was introduced by aspnet/KestrelHttpServer#2368 showed even further improvement compared to dispatching to the threadpool. You can look at both PRs for the benchmark results we got at the time on Windows.

For the SocketSender, the difference was within the noise level IIRC, but that makes sense since sends should always complete immediately when there's no backpressure like in the plaintext and json benchmarks.

@halter73 halter73 closed this Apr 13, 2020
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants