Home > Back-end >  How to measure screen rendering time in Compose and XML?
How to measure screen rendering time in Compose and XML?

Time:09-01

I have 2 similar apps in Compose and XML. XML is using single activity and fragments for each screen. Compose using one activity and composable screens and navigation using Navigation Component for Compose.

I want to measure performance in this apps. I need to measure somehow first start time and time from opening to rendering first frame of each screen. I tried to find something and met some articles on Medium but their more about results and not about how to setup something for measurement

CodePudding user response:

Have a look at the Macrobenchmark library. That will allow you to measure startup time and rendering performance.

Blog: https://medium.com/androiddevelopers/measure-and-improve-performance-with-macrobenchmark-560abd0aa5bb

Docs: https://developer.android.com/topic/performance/benchmarking/macrobenchmark-overview

Codelab: https://developer.android.com/codelabs/android-macrobenchmark-inspect#0

Sample: https://github.com/android/performance-samples/tree/main/MacrobenchmarkSample

  • Related