Skip to content

Create feature flag to make estimation for remaining time in frame for view preallocation more precise#46563

Closed
rubennorte wants to merge 1 commit into
facebook:mainfrom
rubennorte:export-D62962341
Closed

Create feature flag to make estimation for remaining time in frame for view preallocation more precise#46563
rubennorte wants to merge 1 commit into
facebook:mainfrom
rubennorte:export-D62962341

Conversation

@rubennorte
Copy link
Copy Markdown
Contributor

Summary:
Changelog: [internal]

Our current implementation of view preallocation on Android runs very early in the frame (during the animation stage, after input and before traversal). In that implementation, we check the remaining time in the frame and we allocate half of that time for view preallocation.

This logic can make us drop frames unnecessarily, if the work that we need to do after this allocated time is longer than we expect. Because we don't know how long the traversal stage will be, we don't account for that time at all (or, at best, we do only use half of the remaining time).

This creates a feature flag to move view preallocation outside of the choreographer, so we can compute the remaining time considering all the work we did in the frame, and not just the work we did in the input stage.

Differential Revision: D62962341

@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 Sep 18, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

…r view preallocation more precise (facebook#46563)

Summary:
Pull Request resolved: facebook#46563

Changelog: [internal]

Our current implementation of view preallocation on Android runs very early in the frame (during the `animation` stage, after `input` and before `traversal`). In that implementation, we check the remaining time in the frame and we allocate half of that time for view preallocation.

This logic can make us drop frames unnecessarily, if the work that we need to do after this allocated time is longer than we expect. Because we don't know how long the `traversal` stage will be, we don't account for that time at all (or, at best, we do only use half of the remaining time).

This creates a feature flag to move view preallocation outside of the choreographer, so we can compute the remaining time considering all the work we did in the frame, and not just the work we did in the input stage.

Reviewed By: javache

Differential Revision: D62962341
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Sep 18, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in fea0aa7.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @rubennorte in fea0aa7

When will my fix make it into a release? | How to file a pick request?

rubennorte added a commit to rubennorte/react-native that referenced this pull request Mar 5, 2025
Summary:
Changelog: [internal]

This effectively reverts D62962341 / facebook#46563 as the experiments didn't provide the expected wins and we don't have bandwidth to iterate on this.

Differential Revision: D70622429
facebook-github-bot pushed a commit that referenced this pull request Mar 5, 2025
…lag (#49841)

Summary:
Pull Request resolved: #49841

Changelog: [internal]

This effectively reverts D62962341 / #46563 as the experiments didn't provide the expected wins and we don't have bandwidth to iterate on this.

Reviewed By: rshest

Differential Revision: D70622429

fbshipit-source-id: c53c9437448c0a7be8f5b4f04d6369efbd99105a
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 Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants