GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Proposal: remove string allocation in `WebSocketServerProtocolHandshakeHandler` · Issue #16488 · netty/netty

Proposal: remove string allocation in WebSocketServerProtocolHandshakeHandler #16488

New issue
Copy link
New issue
Copy link
Closed
#16666
Closed
Proposal: remove string allocation in WebSocketServerProtocolHandshakeHandler#16488
#16666
Copy link
Milestone
4.2.20.Final

Description

@Munoon
Munoon
opened on Mar 16, 2026
Issue body actions

In WebSocketServerProtocolHandshakeHandler, the websocket URL string is allocated every time using the getWebSocketLocation method, regardless of the actual handshaker version being used.
However, this URI is used only by WebSocketServerHandshaker00.

Ideally, we would calculate this URL only when WebSocketServerHandshaker00 is being created, and remove the uri() method from the parent abstract class...
But to maintain backward compatibility, we can instead place the URL components in the WebSocketServerHandshaker constructor itself (boolean isSecureProtocol, String host, String websocketPath) and build the URL each time the uri() method is called.
We can also introduce a cache for this method.

This getWebSocketLocation method is one of the top allocators we see in the project:
Image

Activity

  1. normanmaurer
    added a commit that references this issue on Oct 20, 2026

    Avoid unnecessary String allocation in WebSocketServerProtocolHandsha…

    This issue will close once commit 03eeaca is merged into the '4.2' branch.
    03eeaca
  2. normanmaurer
    closed this as completedin #16666on Oct 20, 2026
  3. normanmaurer
    added this to the 4.2.20.Final milestone on Oct 20, 2026
  4. normanmaurer
    added a commit that references this issue on Oct 20, 2026

    Port 5.0: Avoid unnecessary String allocation in WebSocketServerProto…

    This issue will close once commit 196bb3a is merged into the '4.2' branch.
    196bb3a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      • 4.2.20.Final

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.