Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
stream: pre-allocate _events#50428
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
stream: pre-allocate _events #50428
Uh oh!
There was an error while loading. Please reload this page.
Conversation
nodejs-github-bot commented Oct 27, 2023 • edited by ronag
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by ronag
Uh oh!
There was an error while loading. Please reload this page.
Review requested:
|
rluvaton commented Oct 27, 2023
Will continue the review tomorrow night, but one general note, I think you should avoid deleting those events when removing listener, and IIRC I think we use the number of keys exists in order to see how many events we listen to |
mcollina left a comment
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.
lgtm
ronag commented Oct 27, 2023
54755f2 to 4e46fdfComparenodejs-github-bot commented Oct 27, 2023
cc6dfe0 to 89ad099Comparenodejs-github-bot commented Oct 27, 2023
nodejs-github-bot commented Oct 28, 2023
673f925 to 507478eCompareUh oh!
There was an error while loading. Please reload this page.
| else | ||
| deleteevents[type]; | ||
| } | ||
| this[kShapeMode]=false; |
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.
Why? What if we just have an object template (template in the abstract way not v8 one) and use that when resetting? (Same for the one below)
(This is not really important comment as it's not happening on a regular basis)
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 don't understand
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.
Maybe reset _events to the template you provided (e.g. with data event key) instead to the default one (i.e. empty with proto null)
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.
That would require us to keep the template in memory and then create copies. Maybe having some kind of reset/initEvents override is better but starts to make things complciated.
| if(!(thisinstanceofDuplex)) | ||
| returnnewDuplex(options); | ||
| this._events??={ |
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 don't really think we should modify the private property _events like that, maybe have an option or an api for setting events template in the EventEmitter class?
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.
Follow up PR welcome?
nodejs-github-bot commented Oct 29, 2023
Landed in 2aaa21f |
No longer necessary given recent stream and event optimziations. Refs: nodejs#50428 Refs: nodejs#50439 PR-URL: nodejs#50440
No longer necessary given recent stream and event optimziations. Refs: nodejs#50428 Refs: nodejs#50439 PR-URL: nodejs#50440
No longer necessary given recent stream and event optimziations. Refs: nodejs#50428 Refs: nodejs#50439 PR-URL: nodejs#50440
No longer necessary given recent stream and event optimziations. Refs: nodejs#50428 Refs: nodejs#50439 PR-URL: nodejs#50440
PR-URL: nodejs#50428 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #50428 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #50428 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #50428 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
Qard commented Dec 28, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
This seems to have broken the |
Refs: #50428 PR-URL: #51925 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Refs: #50428 PR-URL: #51925 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Refs: #50428 PR-URL: #51925 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Refs: #50428 PR-URL: #51925 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Refs: nodejs#50428 PR-URL: nodejs#51925 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.