doc: add ReflectConstruct to known perf issues

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Vinicius Lourenço authored and Michaël Zasso committed 2023-10-23 08:19:37 +02:00
1 parent dd66fdfb7b
commit dacee4d9b5
1 file changed
+3
+3
View File
@@ -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.