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

websocket: proposal for a new core module #49478

Closed
wants to merge 15 commits into from

Commits on Sep 4, 2023

  1. websocket: proposal for a new core module

    This is a proposal to add websockets as a new module for Node.js.
    
    This implementation attempts to adhere to RFC 6455. If differences are
    identified I will supply the necessary changes. This implementation does
    not attempt to parse connection header values, such as extensions or
    sub-protocols values.
    
    This proposal focuses exclusively on Node's APIs from its core modules
    and then supplies additional options as necessary to populate callbacks
    and RFC 6455 connection header values.
    
    Some notes about performance.
    
    Everybody that writes a websocket library wants to measure performance
    in terms of message sent speed, which seems to be a red herring. Message
    send speed is trivial compared to message receive speed.
    
    Message send speed appears to be a memory bound operation. Using this
    approach to websockets I send at about 180,000 messages per second on my
    old desktop computer with slow DDR3 memory. On my newer laptop with
    faster DDR4 memory I can send at about 460,000 - 480,000 messages per
    second. This speed is largely irrelevant though because at around
    460,000 messages garbage collection kicks in and message send speed
    slows to a crawl at around 5,000 per second.
    
    Message receive speed is much slower and far more dependent upon the
    speed of the CPU. On my old desktop I can receive messages at a speed of
    around 18,000 messages per second while on my laptop its a bit slower at
    around 12,000-15,000 messages per second because the desktop has a more
    powerful CPU. The speed penalty on message reception appears to be due
    to analysis for message fragmentation. This approach accounts for 4
    types of message fragmentation.
    prettydiff committed Sep 4, 2023
    Configuration menu
    Copy the full SHA
    63df2bc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b32c6b6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2e8e57f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    886f0e9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2649ead View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b1ae17e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0359628 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f8d2888 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ab2d1a9 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    56f5bdb View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    7bda7b1 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    dfba03f View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2023

  1. Configuration menu
    Copy the full SHA
    142570c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    92f75c1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    93b0938 View commit details
    Browse the repository at this point in the history