Skip to content

Conversation

@AArnott
Copy link
Member

@AArnott AArnott commented Aug 4, 2025

Fixes #1234

@AArnott AArnott added this to the v2.23 milestone Aug 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the performance of the WebSocketMessageHandler by optimizing memory allocation in the WriteCoreAsync method. It modifies the Sequence<byte> constructor to use a shared array pool and sets a minimum span length hint.

  • Uses ArrayPool<byte>.Shared instead of default memory allocation for the sequence builder
  • Sets MinimumSpanLength property to this.sizeHint to optimize buffer sizing

@AArnott AArnott enabled auto-merge August 4, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Websocket message handler writes should consider setting MinimumSpanLength.

3 participants