events: re-use the same isTrusted getter#34459
Closed
addaleax wants to merge 1 commit intonodejs:masterfrom
Closed
events: re-use the same isTrusted getter#34459addaleax wants to merge 1 commit intonodejs:masterfrom
addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
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
Collaborator
|
CI: https://ci.nodejs.org/job/node-test-pull-request/32439/ (:green_heart:) |
4 tasks
Member
Author
|
👍 to fast-track? seems like there is no harm in doing that |
|
Is there any measurable performance benefit due to this change? |
Member
Author
|
@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 <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Member
|
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 <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
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 <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
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 <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
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 <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
4 tasks
3 tasks
3 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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