react-native icon indicating copy to clipboard operation
react-native copied to clipboard

RN: Further Optimize `createAnimatedComponent`

Open yungsters opened this issue 1 year ago • 1 comments

Summary: In addition to memoizing mergedStyle in createAnimatedComponent, this avoids unnecessary object allocations by:

  • Not allocating passthroughProps, created via a rest spread operator. It is unnecessary because we always override style in the JSX.
  • Not allocating a new object if either style or passthroughStyle are null or undefined. Also, create an array of the two style objects instead of spreading them, which is needless.

Changelog: [General][Changed] - Improved performance of Animated components

Reviewed By: sammy-SC

Differential Revision: D56621191

yungsters avatar Apr 26 '24 08:04 yungsters

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,460,096 -7
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,833,652 +30
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: be06fd4e22a500128d202436600381b8bc17b3f5 Branch: main

analysis-bot avatar Apr 26 '24 09:04 analysis-bot

Merged as https://github.com/facebook/react-native/commit/452373b5bf4469d42af722851035e5e9bc3acdb9

javache avatar Jun 27 '24 20:06 javache