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

Combine the two NIOAsyncChannel channel handlers #2779

Merged
merged 3 commits into from
Jul 12, 2024

Commits on Jul 12, 2024

  1. Combine the two NIOAsyncChannel channel handlers

    Motivation:
    
    The NIOAsyncChannel allocates 12 times on init. 4 of these allocations
    come from creating two channel handlers and two channel handler
    contexts. There's no inherent reason that these channel handlers can't
    be combined to eliminate two allocations (one handler and one context).
    
    Modifications:
    
    - Combine `NIOAsyncChannelInboundStreamChannelHandler` and
      `NIOAsyncChannelOutboundWriterHandler` into a single
      `NIOAsyncChannelHandler`. Most of this was straightforward as only a
      few handler operations were duplicated across both.
    - Add a 'NIOAsyncChannelHandlerWriterDelegate' in place of the
      'NIOAsyncChannelOutboundWriterHandler.Delegate'. One knock on from
      this is that the new delegate stores callbacks rather than the
      concrete type of the handler. This is necessary to prevent the
      generics from the new channel handler bubbling up to the outbound
      writer (which would break API and be somewhat odd).
    
    Result:
    
    Fewer allocations
    glbrntt committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    71741b5 View commit details
    Browse the repository at this point in the history
  2. Update alloc limits

    glbrntt committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    ab6adb4 View commit details
    Browse the repository at this point in the history
  3. add nightly main alloc limits

    glbrntt committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    53506cf View commit details
    Browse the repository at this point in the history