apple / swift-nio-http2

HTTP/2 support for SwiftNIO
https://swiftpackageindex.com/apple/swift-nio-http2/main/documentation/niohttp2
Apache License 2.0
462 stars 82 forks source link

Add alloc tests for alternative stream creation API #451

Closed gjcairo closed 2 months ago

gjcairo commented 2 months ago

Allocation tests currently use a func that takes a promise to create the stream multiplexer. However, we also provide a different API that doesn't require a promise and instead returns an EventLoopFuture<Channel>. We don't currently have allocation tests for the latter, so this PR duplicates the current H2 tests but uses the non-promise API to create the multiplexer. I also had to add a new method on the old H2 multiplexer to conform to a test protocol.

glbrntt commented 2 months ago

Instead of adding more of those "old" tests can we please adopt the new benchmarking. We have to migrate over anyways so we should use chances like this to start the move.

I generally agree but in this instance we're just modifying an existing test so the overhead is low.

I think it makes more sense to get the scaffolding for new benchmarks done across all of our repos in one go and then migrate the tests over time. Bootstrapping the setup is always more painful than you think it's going to be...