mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
503a6f4463
Summary: Props are transferred from C++ to Java using ReadableNativeMaps. The current implementation of ReadableNativeMaps creates an internal HashMap the first time one of its methods is executed. During the update of props ReadableNativeMaps are consumed only once and they are accessed through an Iterator. That's why there is no reason to create the internal HashMap, which is inefficient from performance and memory point of view. This diff creates an experiment that avoids the creation of the internal HashMap during prop updates, additionally it removes a lock that was being used in the creation of the internal HashMap. I expect this change to have a positive impact in TTRC and memory (in particular for ME devices) This diff reduces the amount of ReadableNativeMaps's internal HashMaps created during initial render of MP Home by ~35%. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D25361169 fbshipit-source-id: 7b6efda11922d56127131494ca39b5cec75f1703