Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved skipping commits #4833

Merged
merged 4 commits into from
Aug 29, 2023

Conversation

michalmaka
Copy link
Contributor

@michalmaka michalmaka commented Jul 27, 2023

Summary

During investigation of race between RN and reanimated shadow tree committing I've noticed that if JS thread commits a new tree (triggering pleaseSkipReanimatedCommit) after starting commit from reanimated, the latter commit may cause JS commit failures.

What's more, additional calls to shouldReanimatedSkipCommit result in avoiding CPU consuming copy operations on nodes and thus seems to work more performant.

I added those checks just before each operation handling and just after full commit.

Chessboard example seemed to work a bit faster that without those changes. I used also profiler and in overall CPU spends less time in ShadowTree.

NOTICE ⚠️
This change requires change in RN codebase. PR has been submitted facebook/react-native#38715

Test plan

Check performance of e.g. chessboard example.

@efstathiosntonas
Copy link
Contributor

@michalmaka you're on fire! 💪 🔥

@tomekzaw tomekzaw self-requested a review July 27, 2023 11:14
@tomekzaw
Copy link
Member

tomekzaw commented Aug 8, 2023

⚠️ Wait for facebook/react-native#38715

@efstathiosntonas
Copy link
Contributor

@tomekzaw I've asked rn team to pick it on 0.72.4 reactwg/react-native-releases#83 (comment)

@efstathiosntonas
Copy link
Contributor

efstathiosntonas commented Aug 8, 2023

Hey folks, this was picked from rn team for 0.72.4. Thank you for your hard work

Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed internally, let's add #ifdefs for RN version not to change the behavior of 0.72.x since this PR requires things which were added in 0.72.4.

Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

@tomekzaw tomekzaw added this pull request to the merge queue Aug 29, 2023
Merged via the queue into software-mansion:main with commit fd6d363 Aug 29, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants