From 0a1c2efcc120903e0dc29d5faaf710c5fc7a6676 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 2 Aug 2023 13:42:14 -0700 Subject: [PATCH] Update facebook::react::kNumberOfPropsPerComponentSoftCap Summary: `butter::small_vector` is backed by a `folly:small_vector` on non-Android platforms in release mode. It uses the small vector optimization, keeping a fixed size buffer, then falling back to heap allocation. When I was debugging through props parsing code to figure out a prop not getting passed to Fabric (was being filtered in ViewConfig), I noticed this vector is filled with 199 elements for ViewProps. So It always overflows the current capacity and falls back to heap allocation. This bumps the capacity basde on what I observed with some more headroom. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D47981105 fbshipit-source-id: 3870d8e4fee9748c487d01cc82284de865ea370d --- .../ReactCommon/react/renderer/core/RawPropsPrimitives.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/core/RawPropsPrimitives.h b/packages/react-native/ReactCommon/react/renderer/core/RawPropsPrimitives.h index 490991a1a03..18fac05b91b 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/RawPropsPrimitives.h +++ b/packages/react-native/ReactCommon/react/renderer/core/RawPropsPrimitives.h @@ -40,7 +40,7 @@ constexpr static RawPropsValueIndex kRawPropsValueIndexEmpty = * about twenty. It's okay if some `*Props` class has more than this amount of * props but the majority of those classes should be below this cap. */ -constexpr static auto kNumberOfPropsPerComponentSoftCap = 150; +constexpr static auto kNumberOfPropsPerComponentSoftCap = 250; /* * The maximum length of the prop name.