From aa9b94a80eadde7737417eb7d412559bc567c77c Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 31 Mar 2023 21:28:21 +0530 Subject: 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` | --- ext/node/polyfills/internal/crypto/random.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/node') diff --git a/ext/node/polyfills/internal/crypto/random.ts b/ext/node/polyfills/internal/crypto/random.ts index 07d91976a..04678b6be 100644 --- a/ext/node/polyfills/internal/crypto/random.ts +++ b/ext/node/polyfills/internal/crypto/random.ts @@ -92,7 +92,7 @@ export function checkPrime( ); } - core.opAsync(op, candidate, checks).then( + core.opAsync2(op, candidate, checks).then( (result) => { callback?.(null, result); }, -- cgit v1.2.3