perf(ext/websocket): Reduce GC pressure & monomorpize op_ws_next_event (#19405)

Reduce the GC pressure from the websocket event method by splitting it
into an event getter and a buffer getter.

Before:
165.9k msg/sec

After:
169.9k msg/sec
This commit is contained in:
Matt Mastracci 2023-06-08 09:32:08 -06:00 committed by GitHub
parent f35161d3c5
commit 976c381045
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 127 additions and 78 deletions

View file

@ -150,7 +150,7 @@ Deno.test({
Deno.test(
{ sanitizeOps: false },
function websocketConstructorWithPrototypePollusion() {
function websocketConstructorWithPrototypePollution() {
const originalSymbolIterator = Array.prototype[Symbol.iterator];
try {
Array.prototype[Symbol.iterator] = () => {