SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Add support for longer tasks with explicit yielding in LongTask API (#45471)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45471

Changelog: [internal]

This is a React Native specific modification of the Long Tasks API that refines the logic to detect long tasks considering voluntary yielding checks.

In RN, as opposed to Web, we can have a very long task executing in the JS thread without causing any issues to the responsiveness of the app, as long as the task checks whether it should yield in short intervals. In this case, if the app always checks whether it should yield at least once every 50ms, the task will not be considered "long".

Check the new unit tests to see this behavior in practice.

Reviewed By: sammy-SC

Differential Revision: D55647992

fbshipit-source-id: 82ab41173d4d9deee65b8ade2268c40d7f58c6e2
R
Rubén Norte committed
15b8ac8db26d4c83fc38da4889ad9d72c8a405ca
Parent: 64c4e38
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 7/18/2024, 12:08:58 PM