From dacee4d9b54ce405d80945d9b8d6dc57f888a12e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vinicius=20Louren=C3=A7o?= <12551007+H4ad@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:28:08 -0300 Subject: [PATCH] doc: add ReflectConstruct to known perf issues PR-URL: https://github.com/nodejs/node/pull/50111 Reviewed-By: Yagiz Nizipli Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel Reviewed-By: Matteo Collina --- doc/contributing/primordials.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/contributing/primordials.md b/doc/contributing/primordials.md index 5570a17f6bc5bc..b763c88880f94c 100644 --- a/doc/contributing/primordials.md +++ b/doc/contributing/primordials.md @@ -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.