-
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
Benchmarks for different header sizes #824
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
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.
Small nit, but LGTM
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
I'm surprised by the HTTP performance not changing! Are you sure that the benchmarks are actually testinng a handshake/http round trip? I might be reading wrong but offhand it looks like they just build an HttpClient/WsClient, and the |
The HTTP benchmark is only measuring the actual roundtrip which looks legit to me. Lemme try benchmarking much bigger headers |
I'd be interested in that! And ah yes, the http benchmarking code does more than I initially saw :) |
/// Bench WS handshake with different header sizes. | ||
fn ws_custom_headers_handshake(rt: &TokioRuntime, crit: &mut Criterion, url: &str, name: &str, request: RequestType) { | ||
let mut group = crit.benchmark_group(request.group_name(name)); | ||
for header_size in [0, KIB, 2 * KIB, 4 * KIB] { |
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.
FWIW, I find it weird that soketto rejects 8 KIB when it has this
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.
Yep, I think that was the reason why I had to limit the benchmarks to 8 KiB unfortunately.
name: &str, | ||
request: RequestType, | ||
) { | ||
let method_name = request.methods()[0]; |
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.
I changed that we just test this against one specific JSON-RPC call i.e, we don't really care about which call it is.
The only we care about is the overhead of the headers ^^
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.
This makes sense to me since we only care about the header benchmarking, it should also reduce the bench time 😄
* bench: Expose headers for http clients Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * bench: Add bench for custom HTTP headers Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * bench: Add bench for WS handshakes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * bench: Use KIB instead of `1 * KiB` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tweak http headers size Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
* bench: Expose headers for http clients Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * bench: Add bench for custom HTTP headers Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * bench: Add bench for WS handshakes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * bench: Use KIB instead of `1 * KiB` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tweak http headers size Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This PR adds benchmarks for:
Results
HTTP
WS