diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-12-26 18:30:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 02:30:26 +0100 |
commit | 0efe438f7c191d8504355e03b27fe7e3055c9387 (patch) | |
tree | b96fe9a897eb6941c87a95a04520662d26c02fbe /runtime/js/11_workers.js | |
parent | e33c5eb704c22fad69876e87d9b852a4e5072a7a (diff) |
perf: remove opAsync (#21690)
`opAsync` requires a lookup by name on each async call. This is a
mechanical translation of all opAsync calls to ensureFastOps.
The `opAsync` API on Deno.core will be removed at a later time.
Diffstat (limited to 'runtime/js/11_workers.js')
-rw-r--r-- | runtime/js/11_workers.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js index 60ea94bf4..e8e66848e 100644 --- a/runtime/js/11_workers.js +++ b/runtime/js/11_workers.js @@ -30,6 +30,10 @@ import { MessagePortPrototype, serializeJsMessageData, } from "ext:deno_web/13_message_port.js"; +const { + op_host_recv_ctrl, + op_host_recv_message, +} = core.ensureFastOps(); function createWorker( specifier, @@ -58,11 +62,11 @@ function hostPostMessage(id, data) { } function hostRecvCtrl(id) { - return core.opAsync("op_host_recv_ctrl", id); + return op_host_recv_ctrl(id); } function hostRecvMessage(id) { - return core.opAsync("op_host_recv_message", id); + return op_host_recv_message(id); } class Worker extends EventTarget { |