Skip to content
Merged
Changes from 4 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 consider creating a shared class. See [nodejs/performance#109](https://github.com/nodejs/performance/issues/109)

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