Skip to content

Conversation

@rozele
Copy link
Contributor

@rozele rozele commented May 1, 2025

Summary:
To be able to take advantage of the ReactNativeFeatureFlags::enableDestroyShadowTreeRevisionAsync feature, the iOS host platform implementation needs to supply a LowPriorityExecutor.

This adds a LowPriorityExecutor implementation using a low priority dispatch queue.

Changelog

[Internal]

Differential Revision: D73945440

rozele added 2 commits May 1, 2025 04:53
Summary:
In some apps, we spend a non-trivial amount of time calling ShadowNode destructors on the UI thread.

A simple way to avoid stalling the UI thread is to move the `baseRevision_` instance to a data structure that is cleared on a background thread, so it's tree of ShadowNode shared_ptrs are released (and in most cases destroyed) on the background thread.

To avoid thread initialization costs, this change adds an AsyncDestructor helper that uses a single background thread and a queue of to-be-destroyed objects that are released in a run loop.

This change is also guarded by a feature flag so we can keep an eye out for potential memory leaks.

## Changelog

[Internal]

Differential Revision: D73688009
Summary:
To be able to take advantage of the ReactNativeFeatureFlags::enableDestroyShadowTreeRevisionAsync feature, the iOS host platform implementation needs to supply a LowPriorityExecutor.

This adds a LowPriorityExecutor implementation using a low priority dispatch queue.

## Changelog

[Internal]

Differential Revision: D73945440
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels May 1, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D73945440

@react-native-bot
Copy link
Collaborator

This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.

@react-native-bot
Copy link
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added Stale There has been a lack of activity on this issue and it may be closed soon. and removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants