[Rust] Add tokio-ws - WebSocket#814
Merged
Merged
Conversation
Hand-rolled WebSocket echo server on raw tokio, with no WebSocket library. The RFC 6455 handshake (including from-scratch SHA-1 + base64), frame parser/masking, and echo write path are implemented directly on a tokio TcpStream. Serving model is one current_thread runtime per core with SO_REUSEPORT sharding, matching the other engine-tier entries. Subscribes to echo-ws and echo-ws-pipeline. Passes validate-ws.py (7/7) locally and via the Docker build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
/benchmark -f tokio-ws |
Contributor
|
👋 |
Contributor
Benchmark ResultsFramework:
Full log |
Owner
Author
|
/benchmark -f tokio-ws --save |
Contributor
|
👋 |
Contributor
Benchmark ResultsFramework:
Full log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
A WebSocket echo server written directly on raw tokio, with the WebSocket protocol hand-rolled — no
tokio-tungstenite, nowtx, no WS library.Added as an
engine-tier entry: the lowest-level way to serveecho-wson the tokio reactor, so the leaderboard shows what the runtime itself does once framing is reduced to the minimum.Hand-rolled
Sec-WebSocket-Acceptderivation, and the101reply, with from-scratch SHA-1 + base64. The only dependencies aretokioandsocket2.Ping→Pong,Closeechoed.Serving model
One
current_threadruntime per core, each binding:8080withSO_REUSEPORT(kernel-sharded accept, no cross-core work-stealing).TCP_NODELAYper connection; outgoing echoes are batched per read so a pipelined burst flushes in one write. Same shape as the other one-thread-per-core engine entries (e.g.rust-epoll).Tests
Subscribes to
echo-wsandecho-ws-pipeline. Passesvalidate-ws.py(7/7) locally and via the Docker build.🤖 Generated with Claude Code