perf research: WebSocket#7
Draft
crowlbot wants to merge 1 commit into
Draft
Conversation
Honest finding: no high-impact architectural slowdown in Deno's WebSocket. Client beats Node 22 by 6.5x on 64KB binary frames and Bun by 2.2x. Small text is 1.36x faster than Node and 28% slower than Bun. Server-side echo throughput is within 6-25% of Bun depending on message size, with the biggest gap on small text. The gap is in unattributed native ticks (mio/tokio/WS framing in deno binary, ~65% of total ticks) and native flamegraphs are blocked on this host (perf_event_paranoid=4, no sudo). Recording as unranked rather than speculating. No graduated upstream fix.
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.
TL;DR
Honest finding: no high-impact architectural slowdown in Deno's WebSocket.
Headline ratios
Client side (msgs/s, higher is better), Deno reference server
Server side (Deno client, Deno vs Bun server)
Where the time goes — V8 prof on Deno client
65% of ticks in native code. JS-side overhead is uneventful — no obvious hot path to attack.
Hypotheses considered
What's not here
wsnpm package).perf_event_paranoid = 4, no sudo on host).Final ranking
none — no high-impact slowdown to graduate. The 25% small-text server gap is real but currently unattributed.
Layout
```
tools/perf_research/websocket/
README.md full report
micro/ws_server.js Deno echo server (reference)
micro/ws_server_bun.js Bun echo server (cross-check)
micro/ws_client.js universal WS client bench
profiles/ws_results.log raw bench output
profiles/ws_client.prof.txt V8 --prof for Deno client
profiles/versions.txt runtime versions + host caps
```