Ship large meassure cache in all platforms

Summary:
Ship large meassure cache in all platforms

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D40356835

fbshipit-source-id: 315862d7aa705e83086e102e20fe2c20fb3210b2
This commit is contained in:
David Vacca 2022-10-18 13:32:03 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 4f7b4d8cbb
Коммит 9578c2cadf
4 изменённых файлов: 2 добавлений и 15 удалений

Просмотреть файл

@ -84,12 +84,6 @@ public class ReactFeatureFlags {
public static boolean insertZReorderBarriersOnViewGroupChildren = true; public static boolean insertZReorderBarriersOnViewGroupChildren = true;
/**
* Feature Flag to control the size of the cache used by TextLayoutManager in Fabric. Used from
* JNI.
*/
public static boolean enableLargeTextMeasureCache = true;
public static boolean dispatchPointerEvents = false; public static boolean dispatchPointerEvents = false;
/** Feature Flag to enable the pending event queue in fabric before mounting views */ /** Feature Flag to enable the pending event queue in fabric before mounting views */

Просмотреть файл

@ -443,10 +443,6 @@ void Binding::installFabricUIManager(
dispatchPreallocationInBackground_ = reactNativeConfig_->getBool( dispatchPreallocationInBackground_ = reactNativeConfig_->getBool(
"react_native_new_architecture:dispatch_preallocation_in_bg"); "react_native_new_architecture:dispatch_preallocation_in_bg");
contextContainer->insert(
"EnableLargeTextMeasureCache",
getFeatureFlagValue("enableLargeTextMeasureCache"));
// Props setter pattern feature // Props setter pattern feature
CoreFeatures::enablePropIteratorSetter = CoreFeatures::enablePropIteratorSetter =
getFeatureFlagValue("enableCppPropsIteratorSetter"); getFeatureFlagValue("enableCppPropsIteratorSetter");

Просмотреть файл

@ -71,7 +71,7 @@ class TextMeasureCacheKey final {
* The number was empirically chosen based on approximation of an average amount * The number was empirically chosen based on approximation of an average amount
* of meaningful measures per surface. * of meaningful measures per surface.
*/ */
constexpr auto kSimpleThreadSafeCacheSizeCap = size_t{256}; constexpr auto kSimpleThreadSafeCacheSizeCap = size_t{1024};
/* /*
* Thread-safe, evicting hash table designed to store text measurement * Thread-safe, evicting hash table designed to store text measurement

Просмотреть файл

@ -146,10 +146,7 @@ Size measureAndroidComponentMapBuffer(
TextLayoutManager::TextLayoutManager( TextLayoutManager::TextLayoutManager(
const ContextContainer::Shared &contextContainer) const ContextContainer::Shared &contextContainer)
: contextContainer_(contextContainer), : contextContainer_(contextContainer),
measureCache_( measureCache_(kSimpleThreadSafeCacheSizeCap) {}
contextContainer->at<bool>("EnableLargeTextMeasureCache")
? 1024
: kSimpleThreadSafeCacheSizeCap) {}
void *TextLayoutManager::getNativeTextLayoutManager() const { void *TextLayoutManager::getNativeTextLayoutManager() const {
return self_; return self_;