From 0b023538a058fc5e68709aaceeb71902fe850bc7 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 13 Apr 2023 04:21:47 +0530 Subject: [PATCH] perf(ext/websocket): make `op_server_ws_next_event` deferred (#18632) Avoid attempting to read immediately, wasting time polling the future. 2% throughput improvement on Linux. --- ext/websocket/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/websocket/server.rs b/ext/websocket/server.rs index 4b47c88c80..eb8737b192 100644 --- a/ext/websocket/server.rs +++ b/ext/websocket/server.rs @@ -136,7 +136,7 @@ pub async fn op_server_ws_close( Ok(()) } -#[op] +#[op(deferred)] pub async fn op_server_ws_next_event( state: Rc>, rid: ResourceId,