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

Improve PerformanceMonitor's functionality #6241

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

latekvo
Copy link
Contributor

@latekvo latekvo commented Jul 9, 2024

Summary

PerformanceMonitor unnecessarily used accumulator and time delta calculations.
I replaced those with time range measurement and added component props to modify smoothing amount.

Additionally smoothing is now modifiable via the PerformanceMonitorProps,
which are exported alongside PerformanceMonitor

Test plan

Not consistently reproducible.

Issue videos:

exhibit 1 (smoothing=5) exhibit 2 exhibit 3
Screen.Recording.2024-07-09.at.11.21.25.mov
Screen.Recording.2024-07-09.at.10.55.31.mov
Screen.Recording.2024-07-09.at.10.34.47.mov

New code video:

Screen.Recording.2024-07-09.at.12.18.00.mov

Related

This PR is a simpler successor to this PR.

@latekvo latekvo changed the title Fix performance monitor fps leaks Improve PerformanceMonitor's functionality Jul 9, 2024
@latekvo latekvo marked this pull request as ready for review July 9, 2024 11:59
Copy link
Contributor

@szydlovsky szydlovsky left a comment

Choose a reason for hiding this comment

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

Looks good and much much simpler, I like it 😄

Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

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

Looks great 🎉

packages/react-native-reanimated/src/index.ts Outdated Show resolved Hide resolved
@latekvo latekvo added this pull request to the merge queue Jul 15, 2024
Merged via the queue into main with commit 527d9ef Jul 15, 2024
6 checks passed
@latekvo latekvo deleted the @latekvo/fix-performance-monitor-leaks branch July 15, 2024 09:29
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