210.2, max 222.5 timeToInitialDisplayMs min 172.1, median 196.0, max 204.3 Traces: Iteration 0 1 2 3 4 StartupBenchmarks_startupCompilationPartial timeToFullDisplayMs min 197.5, median 208.5, max 265.6 timeToInitialDisplayMs min 185.8, median 196.1, max 246.4 Traces: Iteration 0 1 2 3 4 StartupBenchmarks_startupCompilationNone timeToFullDisplayMs min 296.1, median 302.1, max 317.3 timeToInitialDisplayMs min 280.6, median 284.4, max 296.9 Traces: Iteration 0 1 2 3 4 StartupTimingMetric Sunflower
var jankStats: JankStats override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // ... // metrics state holder can be retrieved regardless of JankStats initialization val metricsStateHolder = PerformanceMetricsState.getForHierarchy(binding.root) // initialize JankStats for current window jankStats = JankStats.createAndTrack( window, Dispatchers.Default.asExecutor(), jankFrameListener, ) // add activity name as state metricsStateHolder.state?.addState("Activity", javaClass.simpleName) // ... }JankLoggingActivity.kt
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // ... // Metrics state holder can be retrieved regardless of JankStats initialization. val metricsStateHolder = PerformanceMetricsState.getForHierarchy(binding.root) // Initialize JankStats with an aggregator for the current window. jankStatsAggregator = JankStatsAggregator( window, Dispatchers.Default.asExecutor(), jankReportListener ) // Add the Activity name as state. metricsStateHolder.state?.addState("Activity", javaClass.simpleName) }JankAggregatorActivity.kt https://developer.android.com/studio/pro fi le/jankstats
What’s new in App Performanc e IO 21 Measuring Jank and Startup with Macrobenchmark Resources veronikapj GDG Korea Android PilJu BAE developer.android.com