Interaction Latency: Square's User-Centric Mobile Performance Metric

ScyllaDB 92 views 26 slides Jul 01, 2024
Slide 1
Slide 1 of 26
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26

About This Presentation

Mobile performance metrics often take inspiration from the backend world and measure resource usage (CPU usage, memory usage, etc) and workload durations (how long a piece of code takes to run).

However, mobile apps are used by humans and the app performance directly impacts their experience, so we...


Slide Content

Interaction Latency: Square’s User-Centric Mobile Performance Metric Pierre-Yves Ricau / p-y.wtf Android Distinguished Engineer at Square ∈ Block

Testing parties πŸ₯³

Measure resource usage?

Workload durations?

User-Centric Performance Metrics!

User-Centric performance Two broad categories Smoothness Is motion janky? Responsiveness Delay between user action and visible response from system. Human threshold: 69 ms Actual threshold: contextual

Responsiveness

🧠

🧠 πŸ‘‰

🧠 πŸ‘‰ πŸ“±

🧠 πŸ‘‰ πŸ“± πŸ“Έ

🧠 πŸ‘‰ πŸ“± πŸ“Έ πŸ‘€

🧠 πŸ‘‰ πŸ“± πŸ“Έ πŸ‘€

🧠 πŸ‘‰ πŸ“± πŸ“Έ πŸ‘€

Responsiveness Human threshold: 69 ms tactuallabs.com/papers/howMuchFasterIsFastEnoughCHI15.pdf Actual threshold: contextual Load web page App Launch Tap β€œLike” blog.p-y.wtf/user-centric-mobile-performance blog.p-y.wtf/tracking-android-app-launch-in-production

Interaction Latency: span in onClick? showAboutScreenButton.setOnClickListener { val span = tracer.buildSpan("showAboutScreen").start() findNavController().navigate(R.id.about_screen) span.finish() }

Interaction Latency Random task App Main thread System πŸ‘‡ Dispatch UP onClick + update UI πŸ“Έ Render Random task UP vsync start Display Total Interaction Latency onClick span measure

Measuring interaction latency No good APIs or SDK for this today Start: hook into touch dispatching pipeline End: hook into frame rendering pipeline dev.to/pyricau/tap-response-time-jetpack-navigation-4738 github.com/square/papa

Metric Aggregation Square: P90 Per hardware type, app, app version, etc. Sampling Bias droidcon.com/2023/07/20/combating-sampling-bias-in-production-how-to-collect-and-interpret-performance-data-to-drive-growth/

Thresholds <= 100 ms <= 200 ms 200 - 500 ms >= 500 ms IDEAL ACCEPTABLE DEGRADED PAINFUL Source: web.dev/inp

Story time

Aside: adding memory usage

Aside: adding memory usage blog.p-y.wtf/freezes-anrs-check-memory-leaks

P-Y androiddev.social/@py @p-y.wtf on bsky https://p-y.wtf Thank you! Let’s toot & skeet!
Tags