-
Notifications
You must be signed in to change notification settings - Fork 172
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
benches: add benchmark for concurrent connections #430
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Out of curiosity, does the HTTP client preserve the connection to the server, or does it make a new connection on each request?
Good question, the answer is that it depends but we create the new clients in the |
* benches: add benchmark for concurrent connections * address grumbles: use array into_iter
* benches: add benchmark for concurrent connections * address grumbles: use array into_iter
* benches: add benchmark for concurrent connections * address grumbles: use array into_iter
The code is a little bit !DRY but that's because the benchmark itself needs to construct the concrete client.
Interestingly,
HTTP server
throughput seems to be worse than theWS server
for example if one comparesone round trip
withtwo connections
it's around 15x slower on my machine.When it comes to
WebSockets
the actual initial "connection" is excluded but it should at least show how efficient/slow polling each connections is... It's around 10x slower on my machine .Concurrent connections with one roundtrip
Roundtrip with one client