-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Closed
Commits on Sep 4, 2023
-
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.
Configuration menu - View commit details
-
Copy full SHA for 63df2bc - Browse repository at this point
Copy the full SHA 63df2bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for b32c6b6 - Browse repository at this point
Copy the full SHA b32c6b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e8e57f - Browse repository at this point
Copy the full SHA 2e8e57fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 886f0e9 - Browse repository at this point
Copy the full SHA 886f0e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2649ead - Browse repository at this point
Copy the full SHA 2649eadView commit details -
Configuration menu - View commit details
-
Copy full SHA for b1ae17e - Browse repository at this point
Copy the full SHA b1ae17eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0359628 - Browse repository at this point
Copy the full SHA 0359628View commit details -
Configuration menu - View commit details
-
Copy full SHA for f8d2888 - Browse repository at this point
Copy the full SHA f8d2888View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab2d1a9 - Browse repository at this point
Copy the full SHA ab2d1a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 56f5bdb - Browse repository at this point
Copy the full SHA 56f5bdbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7bda7b1 - Browse repository at this point
Copy the full SHA 7bda7b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for dfba03f - Browse repository at this point
Copy the full SHA dfba03fView commit details
Commits on Sep 5, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 142570c - Browse repository at this point
Copy the full SHA 142570cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92f75c1 - Browse repository at this point
Copy the full SHA 92f75c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 93b0938 - Browse repository at this point
Copy the full SHA 93b0938View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.