mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
perf(ext/websocket): use opAsync2 to avoid spread deopt (#18525)
This commit adds a new core API `opAsync2` to call an async op with atmost 2 arguments. Spread argument iterators has a pretty big perf hit when calling ops. | name | avg msg/sec/core | | --- | --- | | 1.32.1 | `127820.750000` | | #18506 | `140079.000000` | | #18506 + #18509 | `150104.250000` | | #18506 + #18509 + this | `157340.000000` |
This commit is contained in:
parent
feab94ff51
commit
aa9b94a80e
8 changed files with 31 additions and 18 deletions
|
@ -215,7 +215,7 @@ const scheduledTimers = { head: null, tail: null };
|
|||
*/
|
||||
function runAfterTimeout(cb, millis, timerInfo) {
|
||||
const cancelRid = timerInfo.cancelRid;
|
||||
const sleepPromise = core.opAsync("op_sleep", millis, cancelRid);
|
||||
const sleepPromise = core.opAsync2("op_sleep", millis, cancelRid);
|
||||
timerInfo.promiseId = sleepPromise[SymbolFor("Deno.core.internalPromiseId")];
|
||||
if (!timerInfo.isRef) {
|
||||
core.unrefOp(timerInfo.promiseId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue