Skip to content
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

doc: add ReflectConstruct to known perf issues #50111

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/contributing/primordials.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ performance of code in Node.js.
* `SafePromiseAny`
* `SafePromiseRace`
* `SafePromisePrototypeFinally`: use `try {} finally {}` block instead.
* `ReflectConstruct`: Also affects `Reflect.construct`.
`ReflectConstruct` creates new types of classes inside functions.
Copy link
Contributor

Choose a reason for 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.

Copy link
Member Author

@H4ad H4ad Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:

ReflectConstruct instantiates a class with a custom constructor.

Instead create a shared class. See [nodejs/performance#109](https://github.com/nodejs/performance/issues/109)
H4ad marked this conversation as resolved.
Show resolved Hide resolved

In general, when sending or reviewing a PR that makes changes in a hot code
path, use extra caution and run extensive benchmarks.
Expand Down
Loading