-
Notifications
You must be signed in to change notification settings - Fork 6k
Avg ms/frame instead of FPS in performance overlay #7443
Conversation
Computing FPS from max ms/frame is misleading and we're no longer just using 60 FPS displays.
|
Can you post a screenshot of what it looks like? |
|
|
||
| // DEPRECATED | ||
| // The frame per second FPS could be different than 60 (e.g., 120). | ||
| static const double kOneFrameMS = 1e3 / 60.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there consumers that still exist that use this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used for drawing 3 horizontal lines: 16ms, 32ms, 48ms (https://github.com/flutter/engine/blob/master/flow/instrumentation.cc#L92)
Eventually, we should remove this altogether and get the refresh rate from #7002
I feel that it's better to do it in another PR to keep each one small and focused.
| << "ms/frame"; | ||
| stream << label_prefix << " " | ||
| << "max " << max_ms_per_frame << " ms/frame, " | ||
| << "avg " << average_ms_per_frame << " ms/frame"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm a little conflicted about showing the average...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are often a few big spikes to make the max very different from the average (e.g., max is 300ms while the average is 11ms). One way of thinking is that average is more about the power consumption while max is more about janks.
|
test? |
liyuqian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hixie : regarding tests, I'll add a golden test to the framework to both guard this feature and other performance overlay regression (e.g., the missing text issue mentioned in this PR description).
|
|
||
| // DEPRECATED | ||
| // The frame per second FPS could be different than 60 (e.g., 120). | ||
| static const double kOneFrameMS = 1e3 / 60.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used for drawing 3 horizontal lines: 16ms, 32ms, 48ms (https://github.com/flutter/engine/blob/master/flow/instrumentation.cc#L92)
Eventually, we should remove this altogether and get the refresh rate from #7002
I feel that it's better to do it in another PR to keep each one small and focused.
| << "ms/frame"; | ||
| stream << label_prefix << " " | ||
| << "max " << max_ms_per_frame << " ms/frame, " | ||
| << "avg " << average_ms_per_frame << " ms/frame"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are often a few big spikes to make the max very different from the average (e.g., max is 300ms while the average is 11ms). One way of thinking is that average is more about the power consumption while max is more about janks.
|
See the edited PR description for a screenshot. |
|
Ping... |
This change follows our trend to move all our performance metrics to frame time instead of FPS. Computing FPS from max ms/frame is misleading and we're no longer just using 60 FPS displays.
Tested on iOS devices. Android devices currently don't show any text because of flutter/flutter#26387
We will add a gold test to the framework for performance overlay to both test this change and prevent regressions like flutter/flutter#26387
Here's a screenshot of the new performance overlay:
