Favour coroutines over callbacks where possible#2
Merged
Conversation
This was referenced Jan 12, 2024
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmarks
Scenarios
Results (req/s)
h2loadrun with a single thread which potentially limits the throughput to have ~300k req/s ceiling.Benchmark details
[2023-10-29] gRPC v1.48.4
[2023-10-29] gRPC v1.48.4 (callback)
1a. Single client with no concurrent streams
1b. Single client with 10 concurrent streams
2a. 10 clients with no concurrent streams
2b. 10 clients with 10 concurrent streams
3a. 100 clients with no concurrent streams
3b. 100 clients with 10 concurrent streams
[2023-11-01] grpc-go v1.56.2
[2023-10-29] grpc-go v1.56.2
1a. Single client with no concurrent streams
1b. Single client with 10 concurrent streams
2a. 10 clients with no concurrent streams
2b. 10 clients with 10 concurrent streams
3a. 100 clients with no concurrent streams
3b. 100 clients with 10 concurrent streams
[2023-10-26] Baseline
[2023-10-26] Baseline (59be46f)
grpcxx/lib/grpcxx/h2/conn.cpp
Line 26 in 59be46f
1a. Single client with no concurrent streams
1b. Single client with 10 concurrent streams
2a. 10 clients with no concurrent streams
2b. 10 clients with 10 concurrent streams
3a. 100 clients with no concurrent streams
3b. 100 clients with 10 concurrent streams
[2023-10-26] Single threaded
[2023-10-26] 15b41bc (single-threaded)
1a. Single client with no concurrent streams
1b. Single client with 10 concurrent streams
2a. 10 clients with no concurrent streams
2b. 10 clients with 10 concurrent sterams
3a. 100 clients with no concurrent streams
3b. 100 clients with 10 concurrent streams
[2023-10-29] Multi-threaded (4 workers)
[2023-10-29] Multi-threaded, 4 workers (3f3680f)
1a. Single client with no concurrent streams
1b. Single client with 10 concurrent streams
2a. 10 clients with no concurrent streams
2b. 10 clients with 10 concurrent streams
3a. 100 clients with no concurrent streams
3b. 100 clients with 10 concurrent streams
[2023-10-29] Multi-threaded (1 worker)
[2023-10-29] Multi-threaded, 1 worker (3f3680f)
1a. Single client with no concurrent streams
1b. Single client with 10 concurrent streams
2a. 10 clients with no concurrent streams
2b. 10 clients with 10 concurrent streams
3a. 100 clients with no concurrent streams
3b. 100 clients with 10 concurrent streams
[2023-11-01] WIP: Multi-threaded (hardware concurrency)
[2023-11-01] WIP: Multi-threaded, hardware concurrency (ba679a2)
This WIP implementation uses a thread-pool to process connections in parallel. A coroutine is suspended in the main thread and resumed in a worker thread to continue processing. There's a bit of wastage of libuv event loops and a slow client will block a thread, hence marked as WIP.
1a. Single client with no concurrent streams
1b. Single client with 10 concurrent streams
2a. 10 clients with no concurrent streams
2b. 10 clients with 10 concurrent streams
3a. 100 clients with no concurrent streams
3b. 100 clients with 10 concurrent streams
[2023-11-06] Multi-threaded (hardware concurrency)
[2023-11-06] Multi-threaded, hardware concurrency (4b13fce)
1a. Single client with no concurrent streams
1b. Single client with 10 concurrent streams
2a. 10 clients with no concurrent streams
2b. 10 clients with 10 concurrent streams
3a. 100 clients with no concurrent streams
3b. 100 clients with 10 concurrent streams
[2023-11-06] Multi-threaded (2 workers)
[2023-11-06] Multi-threaded, 2 workers (4b13fce)
1a.
1b.
2a.
2b.
3a.
3b.