summaryrefslogtreecommitdiff
path: root/ext/websocket/01_websocket.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-03-30 22:00:19 +0530
committerGitHub <noreply@github.com>2023-03-30 16:30:19 +0000
commit30ee8465882d27499344062df05b05af99075c31 (patch)
treea403f7ff147cf9b030f5cf26529ef672024455fa /ext/websocket/01_websocket.js
parentc4f82cab31d1ec09b2bce1f0155f92c7d7bd50e0 (diff)
perf(ext/websocket): special op for sending binary data frames (#18506)
Easy perf win by avoiding deserializing `SendValue` through serde_v8. | name | avg msg/sec/core | | --- | --- | | deno_main | `127820.750000` | | deno_this | `140079.000000` |
Diffstat (limited to 'ext/websocket/01_websocket.js')
-rw-r--r--ext/websocket/01_websocket.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/websocket/01_websocket.js b/ext/websocket/01_websocket.js
index d483608d8..06eb08b60 100644
--- a/ext/websocket/01_websocket.js
+++ b/ext/websocket/01_websocket.js
@@ -301,10 +301,7 @@ class WebSocket extends EventTarget {
const sendTypedArray = (ta) => {
this[_bufferedAmount] += ta.byteLength;
PromisePrototypeThen(
- core.opAsync("op_ws_send", this[_rid], {
- kind: "binary",
- value: ta,
- }),
+ core.opAsync("op_ws_send_binary", this[_rid], ta),
() => {
this[_bufferedAmount] -= ta.byteLength;
},