From 8a2cf6866ddfe5500a9f0a6853179e6b713532f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 25 Mar 2024 09:50:21 -0700 Subject: [PATCH] Disable shadow tree introspection by default (#43578) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43578 Changelog: [internal] We have a feature to do some validation of the mount operations when committing new trees in Fabric. That's very slow but it was ok before because we were only doing this in debug mode and in the JS thread. We're moving some of this work to the UI thread instead and we're seeing an impact on scroll performance. This disables this feature by default but leaves it in code to enable it when necessary for debugging. Reviewed By: NickGerleman, sammy-SC Differential Revision: D55138795 fbshipit-source-id: 45ca47ae2562cecb070691bf33d95c9108a9eca3 --- .../react-native/ReactCommon/react/renderer/debug/flags.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/debug/flags.h b/packages/react-native/ReactCommon/react/renderer/debug/flags.h index f61d5d60219..cc16f03e547 100644 --- a/packages/react-native/ReactCommon/react/renderer/debug/flags.h +++ b/packages/react-native/ReactCommon/react/renderer/debug/flags.h @@ -26,13 +26,11 @@ // Enables some Shadow Tree introspection features (maintains a StubViewTree, // and logs prev/next tree and mutations if there are any discrepancies). If you // define this, also define `RN_DEBUG_STRING_CONVERTIBLE`. -#if (defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE)) -#define RN_SHADOW_TREE_INTROSPECTION 1 -#endif +// #define RN_SHADOW_TREE_INTROSPECTION 1 // This enables certain object-to-string debug conversions to be compiled. -// Enable if `RN_SHADOW_TREE_INTROSPECTION` is enabled. -#ifdef RN_SHADOW_TREE_INTROSPECTION +// Enable if `REACT_NATIVE_DEBUG` is enabled. +#ifdef REACT_NATIVE_DEBUG #define RN_DEBUG_STRING_CONVERTIBLE 1 #else #define RN_DEBUG_STRING_CONVERTIBLE 0