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

Wrong Calculation of FPS #88

Open
atn4z7 opened this issue Apr 6, 2023 · 2 comments
Open

Wrong Calculation of FPS #88

atn4z7 opened this issue Apr 6, 2023 · 2 comments

Comments

@atn4z7
Copy link

atn4z7 commented Apr 6, 2023

Hi guys, thank you so much for this awesome tool. We are using it to measure perf of our mobile app. After a few days of using it on iOS, we realize there is a bug with how the FPS is calculated. Basically, we see the FPS drop to 0 a lot of times while the FPS from React Native pert chart (dev mode) never does. Another thing is that the FPS numbers almost never match the ones from React Native perf chart. From my investigation, it looks like there are 2 things that cause this incorrect calculation of FPS:

1/ React Native pert chart calculates FPS every second while your tool does it every 0.5 second
2/ The error margin 50 ms is not long enough. From my observation, it can go up to 100 ms - 400 ms. Whenever this happens, the FPS will drop to 0.

To work around this issue, we are currently doing this:

flipper-desktop/src/PerfMonitorView.tsx
adjust MEASURE_INTERVAL from 500 to 1000

flipper-desktop/src/utils/getThreadMeasures.ts
adjust INTERVAL from 500 to 1000
adjust ERROR_MARGIN from 50 to 500

flipper-native/ios/FlipperPerformancePlugin.m
adjust else if (frameTimestamp - [frameCountHolder previousTime] >= 1)

With these changes, we are now seeing correct FPS metrics. What are your thoughts? Is this even a correct solution?

Updates: I can confirm this is also an issue on Android.

@BruceSuperProgramer
Copy link

I notice the same problem

@MateoParodi
Copy link

Same problem here

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

No branches or pull requests

3 participants