-
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
events: re-use the same isTrusted getter #34459
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creating a new function each time the property descriptor is set comes with performance overhead, since these functions have different identities, even if they contain the same code. Refs: https://twitter.com/tverwaes/status/1285496612618473472
bnoordhuis
approved these changes
Jul 21, 2020
jasnell
approved these changes
Jul 21, 2020
lpinca
approved these changes
Jul 21, 2020
ZYSzys
approved these changes
Jul 21, 2020
ZYSzys
added
abandoned
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
events
Issues and PRs related to the events subsystem / EventEmitter.
performance
Issues and PRs related to the performance of Node.js.
and removed
abandoned
labels
Jul 21, 2020
CI: https://ci.nodejs.org/job/node-test-pull-request/32439/ (:green_heart:) |
4 tasks
👍 to fast-track? seems like there is no harm in doing that |
Is there any measurable performance benefit due to this change? |
@wa-Nadoo Yes, a bit more than +200 % improvement (i.e. 3× faster than currently): [00:05:03|% 100| 1/1 files | 60/60 runs | 3/3 configs]: Done
confidence improvement accuracy (*) (**) (***)
events/eventtarget.js listeners=10 n=1000000 *** 214.47 % ±1.76% ±2.36% ±3.10%
events/eventtarget.js listeners=1 n=1000000 *** 235.79 % ±3.13% ±4.21% ±5.57%
events/eventtarget.js listeners=5 n=1000000 *** 223.85 % ±2.85% ±3.84% ±5.09% |
jasnell
pushed a commit
that referenced
this pull request
Jul 21, 2020
Creating a new function each time the property descriptor is set comes with performance overhead, since these functions have different identities, even if they contain the same code. Refs: https://twitter.com/tverwaes/status/1285496612618473472 PR-URL: #34459 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
Landed in 08b6335 |
cjihrig
pushed a commit
that referenced
this pull request
Jul 23, 2020
Creating a new function each time the property descriptor is set comes with performance overhead, since these functions have different identities, even if they contain the same code. Refs: https://twitter.com/tverwaes/status/1285496612618473472 PR-URL: #34459 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
ruyadorno
pushed a commit
that referenced
this pull request
Jul 28, 2020
Creating a new function each time the property descriptor is set comes with performance overhead, since these functions have different identities, even if they contain the same code. Refs: https://twitter.com/tverwaes/status/1285496612618473472 PR-URL: #34459 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
Merged
ruyadorno
pushed a commit
that referenced
this pull request
Jul 28, 2020
Creating a new function each time the property descriptor is set comes with performance overhead, since these functions have different identities, even if they contain the same code. Refs: https://twitter.com/tverwaes/status/1285496612618473472 PR-URL: #34459 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
ruyadorno
pushed a commit
that referenced
this pull request
Jul 29, 2020
Creating a new function each time the property descriptor is set comes with performance overhead, since these functions have different identities, even if they contain the same code. Refs: https://twitter.com/tverwaes/status/1285496612618473472 PR-URL: #34459 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
4 tasks
3 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
events
Issues and PRs related to the events subsystem / EventEmitter.
fast-track
PRs that do not need to wait for 48 hours to land.
performance
Issues and PRs related to the performance of Node.js.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Creating a new function each time the property descriptor is set
comes with performance overhead, since these functions have different
identities, even if they contain the same code.
Refs: https://twitter.com/tverwaes/status/1285496612618473472
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes