GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — doc: add ReflectConstruct to known perf issues by H4ad · Pull Request #50111 · nodejs/node Conversation
Member
There are a lot of PRs created initially by nodejs/performance#109 to improve performance issues with this primordial.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
H4ad
marked this pull request as ready for review
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
anonrig
approved these changes
benjamingr
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW the reason isn't ReflectConstruct per-se it's the usage of anonymous (new) classes each time with it that is the problem. Still I generally agree there be very little cases where it is required.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
aduh95
requested changes
| |||||||||||||||||||
|
Maybe: Primordials we should avoid for performance issuesBelow are some primordials that we can avoid to be more performant:
In general, it's not a problem if you don't have an alternative but sometimes you can avoid it by writing the code in a different way and have less overhead. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Have measured if
Otherwise it seems not far-fetched this think the reader might conclude that |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I agree with @aduh95 's comments. We should avoid Reflect.construct as well - otherwise people might see this and use Reflect.construct instead of ReflectConstruct which isn't the point (which is - they should avoid creating new types of classes inside a function instead of having a shared class like in those issues) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Any recommendations on where I should put this recommendation? Should I write something like #50111 (comment) or close this PR? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Uzlopak <[email protected]>
There was an error while loading. Please reload this page.
Co-authored-by: Antoine du Hamel <[email protected]>
There was an error while loading. Please reload this page.
| @@ -124,7 +124,7 @@ performance of code in Node.js. | |||
| * `SafePromisePrototypeFinally`: use `try {} finally {}` block instead. | |||
| * `ReflectConstruct`: Also affects `Reflect.construct`. | |||
| `ReflectConstruct` creates new types of classes inside functions. | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I know I am nitpicking myself.
Maybe should be "at runtime" and not "inside functions".
Sorry.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What about:
ReflectConstructinstantiates a class with a custom constructor.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 340b9a8 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #50111 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #50111 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.