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>
pull/50258/head
Vinicius Lourenço 2023-10-18 16:28:08 -03:00 committed by GitHub
parent b3313bf03f
commit 340b9a827b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

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.