-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Add performance measurements #1264
feat: Add performance measurements #1264
Conversation
e76e118
to
9477980
Compare
9477980
to
550084c
Compare
ef219cf
to
d897dcd
Compare
550084c
to
4c6ccc2
Compare
d897dcd
to
ab61511
Compare
4c6ccc2
to
fabbd4e
Compare
ab61511
to
921476b
Compare
fabbd4e
to
8821f44
Compare
markName: markNameNav, | ||
measureName: 'Mount <Nav />' | ||
}) | ||
}, [markNameNav]) |
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.
nit: What do you think of an extracted hook like usePerformanceMeasure(markName, mesureName)
?
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.
Not sure how to implement it right now, so I propose to implement it in the future if we need it
8821f44
to
07cefb5
Compare
ReactNative only support a subset of the web's Performance API In order to measure our code performance, we want to use `performance.mark()` and `performance.measure()` methods that are not natively supported by ReactNative `react-native-performance` plugin provide those methods and also allow to se results in realtime thanks to `react-native-performance-flipper-reporter` plugin
As we encounter some performances issues in the app startup, we want to add some metrics to understand where time is consumed All measurement are made through the `measure.ts` helper that wraps the `react-native-performance` library and fit the incoming CozyClient performance API Related PR: cozy/cozy-client#1574
`cozy-client` and `cozy-pouch-link` has been upgraded to `51.7.0` in order to retrieve the new Performance API implementation Related PR: cozy/cozy-client#1574
In cozy/cozy-client#1574 we implemented a new CozyClient API that allow to enable CozyClient's internal performances measurements This PR configure CozyClient and related links with a react-native compatible Performance API This will allow us to analyse performances issues on CozyClient when used in the Flagship App environment
We suspected and found some performances issues due to Redux store mutations This commit patches the Redux package in order to measure CozyClient's store updates
Previous commits enabled performances measurements in the app Those performances measures can be read using a Flipper plugin This may be not enough as we want to analyse performance issues on real users devices for which Flipper is not enabled To fix this we introduce a new UniversalLink that allows the user to send their performance data to the Cozy support if they want to To send performance logs, the following links can be used: - https://links.mycozy.cloud/flagship/sendperfs - cozy://sendperfs
This would ease distinguishing the date from the time when reading file name
In previous commit we allowed the users to send their performance logs by email to Cozy's support The sent file contains raw measurement data that cannot be easily read This script allows to convert the sent file to a format supported by Google Chrome's performance devtools In order to make it work, retrieve some user's logs and run the following command: ```shell yarn perf:convert <some_log_file_path> ``` A new file with the same name suffixed by `_converted` will be generated and can be imported to Google Chrome's performance devtools
By default, `react-native-performance-flipper-reporter` does not support custom measurement categories This commit patches `react-native-performance-flipper-reporter` so it will display as many categories as provided to the `rnperformances.measure()` method calls
07cefb5
to
6b4861a
Compare
6b4861a
to
1cc6687
Compare
I added the documentation in |
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.
Nice job!
This PR adds tooling for measuring app's performances.
It is based on recent CozyClient implementation of Performance API and on react-native-performances plugin
This has been done to mitigate missing RN native Performance APIs that implements
performances.now()
but notpreformances.mark()
norpreformances.measure()
The result is that we can now analyze performance through Flipper's plugin
flipper-plugin-performance
Or with a bit of tooling (see commit named
feat: Add conversion script to allow opening logs in Chrome devtools
) it is possible to import those metrics into Google Chrome's devtoolsTODO: