-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Tracking issue for WebSocket performance #16315
Comments
Towards #16315 It created a bunch of Error objects and rejected the promise. This patch changes `op_sleep` to resolve with `true` if it was cancelled.
Always good when perf. is getting better across the industry but I find it a bit underwhelming when I've been pointing this out long before Deno was even conceived, yet received not the slightest ack. or response until someone else (in this case Bun) decided to actually listen to the input given. Anyways - I hope Deno will improve here because it will make us all waste less resources doing common things. |
Btw, if you like load_test.c there is a similar one for http that performs much better than wrk (and hence gives more accurate numbers) under uSockets/examples/ it's called http_load_test.c. That benchmark could sure see some improvements, but is pretty fine as is for finding perf. regressions or differences. |
Towards #16315 It created a bunch of Error objects and rejected the promise. This patch changes `op_sleep` to resolve with `true` if it was cancelled.
Reverted commits (due to bugs):
cc @billywhizz |
@littledivy should we open a new issue for tracking WebSocket performance? It appears most (all?) things listed here were already addressed |
Yeah, I'll open a new one soon. |
…ead of Uint8Array (denoland#16360) Towards denoland#16315
Let's look at a simple ping/pong benchmark.
The goal should be to have as little overhead as possible and be on par with uWebSocket.js and tokio-tungstenite. We should also integrate this test using
uWebSockets/benchmarks/load_test.c
in our CI workflow.After applying the below changes, I see a ~3.5x improvement in the above benchmark:
socket[_idleTimeoutDuration]
logic. chore(ext/websocket): deprecate and remove idleTimeout #16317op_cancel_handle
use fast calls. perf(ext/web): optimizeop_cancel_handle
#16318core.byteLength
instead of doing full utf8 string encoding. perf(ext/websocket): optimize socket.send #16320string
andbinary
values. perf(ext/websocket): optimize socket.send #16320op_try_send_[type]
fast call to try to send values in one go without creating a future. perf(ext/websocket): optimize socket.send #16320op_ws_next_event
:deferred
. We don't want to poll unless there is an event. perf(ext/websocket): optimizeop_ws_next_event
#16325op_ws_next_event
#16325NextEventResponse
is slow. perf(ext/websocket): optimizeop_ws_next_event
#16325AsyncRefCell
try_borrow_mut beforeborrow_mut().await
. perf(ext/websocket): optimize socket.send #16320ReflectDefineProperty
causes deopt. perf(ext/websocket): skip Events constructor checks #16365ReflectHas
checks. perf(ext/websocket): skip Events constructor checks #16365op_queue_microtask
. perf(core): avoid creating global handles inop_queue_microtask
#16359serde_v8::StringOrBuffer
. perf(serde_v8):serde_v8::StringOrBuffer
return JS ArrayBuffer instead of Uint8Array #16360A very sloppy implementation of the above can be found here: main...littledivy:deno:websocket_perf
The text was updated successfully, but these errors were encountered: