Setup Basic Benchmarks for HTTP3 - #128
nerdsupremacist wants to merge 8 commits into
Conversation
| import Benchmark | ||
| import Benchmark |
There was a problem hiding this comment.
| import Benchmark | |
| import Benchmark | |
| import Benchmark |
| }.get() | ||
|
|
||
| let destination = ForwardingDestination(synchronizingOn: eventLoop) | ||
| let forwardTask = Task { |
There was a problem hiding this comment.
We should avoid spawning unstructured tasks. This method should ideally be a with-style method that accepts a closure. In that closure, we would vend the channel as an argument. After the closure has finished executing (either normally or by throwing an error), we would handle cleanup by calling channel.close() for example.
TestHelpers in the test target has some examples of this pattern. See this for example.
The same also applies for BenchmarkHTTP3Server.
| } | ||
| } | ||
|
|
||
| public final class BenchmarkHTTP3Client { |
There was a problem hiding this comment.
I see you've structured the package into multiple targets. public isn't necessary here, it should be replaced with package. The same applies to all other currently public types.
|
|
||
| private func makeHTTP3BenchmarkConfiguration() -> Benchmark.Configuration { | ||
| .init( | ||
| metrics: [.mallocCountTotal, .instructions, .wallClock], |
There was a problem hiding this comment.
We shouldn't add wallclock here since ideally we commit the thresholds and wall clock is unstable on CI/
| ) | ||
| } | ||
|
|
||
| let eventLoop = NIOAsyncTestingEventLoop() |
There was a problem hiding this comment.
I'm not sure how I feel with the artificial testing channel. I would rather us go through a loop back and send packets to it. The testing event loop makes this benchmark otherwise pretty different from what is actually happening.
Motivation
We aim to work on improving performance of the HTTP Server. In order to do so effectively, it makes sense to have a set of benchmarks to measure how we improve over time.
Modifications
Adds a set of Benchmarks. Some are related to specific aspects of the flow. And Some are related to the general integration e2e of the server. We will track instructions, allocations, and time.
In terms of more integrations, we can combine those 3 steps as follows:
Notes for reviewers:
Result