Skip to content
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

Switch to using UnsafeContinuations in NIOAsyncWriter and NIOAsyncSequenceProducer #2541

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Oct 9, 2023

  1. Call NIOAsyncWriterSinkDelegate outside of the lock

    # Motivation
    The current `NIOAsyncWriter` implementation expects that the delegate is called while holding the lock to avoid reentrancy issues. However, this prevents us from executing the delegate calls directly on the `EventLoop` if we are on it already.
    
    # Modification
    This moves all of the delegate calls outside of the locks.
    
    # Result
    Less allocations.
    FranzBusch committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    c299d00 View commit details
    Browse the repository at this point in the history
  2. Switch to using UnsafeContinuations in NIOAsyncWriter and `NIOAsy…

    …ncSequenceProducer`
    
    # Motivation
    During the performance testing of the `NIOAsyncChannel` we saw most of the remaining allocations due to the usage of `CheckedContinuation`. We knew from the beginning that this might be something that we want to revisit down the line.
    
    # Modification
    This PR changes from `CheckedContinuation`s to `UnsafeContination`.
    FranzBusch committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    0f0bcc2 View commit details
    Browse the repository at this point in the history