Skip to content

Commit

Permalink
doc: add ReflectConstruct to known perf issues
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
H4ad authored and targos committed Oct 23, 2023
1 parent dd66fdf commit dacee4d
Showing 1 changed file with 3 additions and 0 deletions.
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.
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

0 comments on commit dacee4d

Please sign in to comment.