RUMM-2687 Invert frame time to get js refresh rate#1105
Merged
louiszawadzki merged 2 commits intoOct 26, 2022
Merged
Conversation
mariusc83
requested changes
Oct 25, 2022
|
|
||
| private fun VitalInfo.toInversePerformanceMetric(): ViewEvent.FlutterBuildTime { | ||
| return ViewEvent.FlutterBuildTime( | ||
| min = invertValue(maxValue), |
Member
There was a problem hiding this comment.
why are you switching min with max here ?
Member
There was a problem hiding this comment.
Maybe a comment to explain that would be nice here. It will be very hard to remember why we are doing this.
Contributor
Author
There was a problem hiding this comment.
I'll add a comment indeed.
If we take the inverse of numbers, min and max are reversed.
For instance if min = 4 and max = 10, then for the inverse min = 1/max = 0.1 and max = 1/min = 0.25
Member
There was a problem hiding this comment.
I got that...what is hard for me to understand is that right now we are inverting the max value to create the min. But is this relevant ?
Codecov Report
@@ Coverage Diff @@
## develop #1105 +/- ##
===========================================
- Coverage 83.29% 83.25% -0.03%
===========================================
Files 273 273
Lines 9363 9368 +5
Branches 1503 1504 +1
===========================================
+ Hits 7798 7799 +1
- Misses 1147 1149 +2
- Partials 418 420 +2
|
louiszawadzki
force-pushed
the
louiszawadzki/rumm-2687/report-harmonic-mean-of-js-refresh-rate
branch
from
October 25, 2022 16:21
5191821 to
bc37e69
Compare
mariusc83
approved these changes
Oct 26, 2022
louiszawadzki
force-pushed
the
louiszawadzki/rumm-2687/report-harmonic-mean-of-js-refresh-rate
branch
from
October 26, 2022 12:30
c0402b7 to
79c3f51
Compare
louiszawadzki
deleted the
louiszawadzki/rumm-2687/report-harmonic-mean-of-js-refresh-rate
branch
October 26, 2022 12:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Let the RN SDK report the frame time, then invert it when reporting to backend to report frame rate.
Motivation
Get a more sensible for the average js refresh rate by getting the harmonic mean instead of the arithmetic mean.
See https://gamedev.net/forums/topic/628085-math-fail-adding-frames-per-second/4960225/ and https://en.wikipedia.org/wiki/Harmonic_mean#Average_speed to understand why this makes more sense.
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)