software-mansion / software-mansion/react-native-reanimated

Upgrading to v3 and encountering performance issues when using Worklet.

Open
#7,239 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Missing info Missing repro Platform: iOS
Dominant language
TypeScript
Stars
11k
Forks
1.5k
Avg merge
3d 4h
Merged PRs (30d)
172

Description

Description

In our project, we have extensively used Reanimated, and everything has been working smoothly. Recently, while upgrading to v3, we encountered severe performance issues. After analyzing the specific time consumption using the Instruments tool on iOS, we found that the problem is caused by the execution of Worklet in Reanimated.

Image

After carefully analyzing the code logic, we discovered that the time consumption is primarily due to the fact that in the v3 version of Reanimated, the Worklet passes the complete Reanimated object, whereas in v2, only the specific properties or methods used are passed.

Time-consuming code:Mainly focused on data transformation.

Image

V3 v2 output diff:

Image

Image

our questions:
1.This change has noticeable performance issues.What is the purpose of the change?
2.Is there any way to bypass this performance issue?

Steps to reproduce
Snack or a link to a repository
Reanimated version

3.6.0

React Native version

0.70.2

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, reproduction steps, or repository is provided. Start by reviewing the Worklet data transformation described for Reanimated 3.6.0 on iOS and compare it with the reported v2 behavior using Instruments. Done means establishing a reproducible performance finding and documenting whether the v3 behavior is intentional or has a supported bypass.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.