mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Let's improve NIOAsyncChannels performance, by using UnsafeContinuations instead of CheckedContinuations. ### Motivation: We want to improve the performance for our async APIs. ### Modifications: - Introduce a new typealias `NIOUnsafeContinuation` that behaves like a UnsafeContinuation in release mode and like a CheckedContinuation in debug mode. - Use the `NIOUnsafeContinuation` inside the `NIOAsyncWriter` - Use the `NIOUnsafeContinuation` inside the `NIOThrowingAsyncSequenceProducer` ### Result: Fewer allocations