From 4cc8784f5b3a71b2a882ff359d593b4b74c9e89b Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 6 Apr 2023 18:44:31 +0530 Subject: perf(ext/websocket): replace tokio_tungstenite server with fastwebsockets (#18587) https://github.com/littledivy/fastwebsockets ``` # This PR ./load_test 100 0.0.0.0 8080 0 0 Running benchmark now... Msg/sec: 176355.000000 # main ./load_test 100 0.0.0.0 8080 0 0 Running benchmark now... Msg/sec: 157198.750000 ``` --- ext/http/01_http.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/http') diff --git a/ext/http/01_http.js b/ext/http/01_http.js index d0aefc0c3..51347ebed 100644 --- a/ext/http/01_http.js +++ b/ext/http/01_http.js @@ -26,8 +26,10 @@ import { _protocol, _readyState, _rid, + _role, _server, _serverHandleIdleTimeout, + SERVER, WebSocket, } from "ext:deno_websocket/01_websocket.js"; import { listen, TcpConn, UnixConn } from "ext:deno_net/01_net.js"; @@ -376,6 +378,7 @@ function createRespondWith( httpConn.close(); ws[_readyState] = WebSocket.OPEN; + ws[_role] = SERVER; const event = new Event("open"); ws.dispatchEvent(event); -- cgit v1.2.3