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: nodejs#50111
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
H4ad authored and alexfernandez committed Nov 1, 2023
1 parent ea2e097 commit 720d714
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 720d714

Please sign in to comment.