Files
Matteo Collina 384d7a40ce events: optimize once() and removeListener()
Use a closure instead of a bound state object for the once() wrapper,
keep the events object shape in removeListener() by storing undefined
instead of deleting keys or reallocating the object, and outline the
cold unhandled 'error' path from emit() and the max-listeners warning
from _addListener() so both fit within V8 inlining budgets.

ee-once +25%, ee-add-remove +12-22%, ee-listen-unique +7-15%,
streams/pipe +13.9%.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64373
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-07-13 08:50:08 +00:00
..