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

Perf Questions around HttpClient using Http/2 #9

Open
AceHack opened this issue Oct 16, 2018 · 2 comments
Open

Perf Questions around HttpClient using Http/2 #9

AceHack opened this issue Oct 16, 2018 · 2 comments

Comments

@AceHack
Copy link

AceHack commented Oct 16, 2018

I created a multiplexed WebSocket client/server based on Pipelines and this example and compared the performance to HttpClient using Http/2 which has multiplexing as well. I get very different results. Am I doing something wrong with HttpClient? Here are my results.

MultiplexedWebSocket: 115,309 per second
HttpClient: 7,075 per second

https://github.com/AceHack/MultiplexedWebSockets

@namse
Copy link

namse commented Apr 12, 2019

@AceHack WebSocket's benchmark is almost the same with my code.

But for HttpClient, actually you just used HttpClient itself, that mean they put something more when WebSocket. For example, they put header, They wait until server send the response. that also could be one of the overhead.

In short

  • WebSocket is the same with TCP, without initiating.
  • HttpClient(Even Http2) has more overhead than Low-Level TCP like WebSocket.

So I guess your benchmark is right.

@AceHack
Copy link
Author

AceHack commented Apr 12, 2019

Http2 is supposed to be multiplexed so I would have expected significant speedups over HttpClient using Http1 but I do not see those speedups. My multiplexed web socket also waits for the server to send the response it just does a ton of them in parallel. Http2 should be able to do the same thing, that is what multiplexing means.

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

No branches or pull requests

2 participants