Skip to content

Commit d4659e2

Browse files
H4adtargos
authored andcommitted
doc: add ReflectConstruct to known perf issues
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]>
1 parent fefe17b commit d4659e2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/contributing/primordials.md

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ performance of code in Node.js.
122122
* `SafePromiseAny`
123123
* `SafePromiseRace`
124124
* `SafePromisePrototypeFinally`: use `try {} finally {}` block instead.
125+
* `ReflectConstruct`: Also affects `Reflect.construct`.
126+
`ReflectConstruct` creates new types of classes inside functions.
127+
Instead consider creating a shared class. See [nodejs/performance#109](https://github.com/nodejs/performance/issues/109).
125128

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

0 commit comments

Comments
 (0)