-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: refactor events.js #36528
lib: refactor events.js #36528
Conversation
@@ -200,7 +200,7 @@ EventEmitter.init = function(opts) { | |||
this._maxListeners = this._maxListeners || undefined; | |||
|
|||
|
|||
if (opts && opts.captureRejections) { | |||
if (opts?.captureRejections) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to benchmark these changes. The entire events.js file is one of the most performance sensitive in core and changes here can have massive impact throughout. Last I benchmarked, optional chaining still had some performance lag that hadn't been fully optimized out. That's not a block on this on it's own but let's be sure to run benchmarks before this lands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also not a fan of the optional chaining operator. I think it hinders readability.
@Lxxyx whoops, thanks for telling :) |
@RaisinTen BTW if you want to help me resolve the perf regressions of #36304, that's be awesome! |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes