From d043a6d72cbf683c70f7eb4b9b3c09003afd2683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 27 Apr 2023 12:47:52 +0200 Subject: perf(ext/websocket): various performance improvements (#18862) - No need to wrap buffer in a `new DataView()` - Deferred ops are still eagerly polled, but resolved on the next tick of the event loop, we don't want them to be eagerly polled - Using "core.opAsync"/"core.opAsync2" incurs additional cost of looking up these functions on each call. Similarly with "ops.*" --------- Co-authored-by: Divy Srivastava --- ext/websocket/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/websocket/lib.rs') diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index df4127d27..9ea341fbb 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -427,7 +427,7 @@ pub async fn op_ws_close( Ok(()) } -#[op(deferred)] +#[op(fast)] pub async fn op_ws_next_event( state: Rc>, rid: ResourceId, -- cgit v1.2.3