~/talk

Let's build a performance measuring tool from scratch

Talkat droidcon London 2024 · 2024-10-31..11-01· [web-performance]
slides:none on file

Live demo shows how to measure per-thread CPU by calling adb shell top -H and by reading /proc entries (parsing /proc/<pid>/task//stat ), converting clock ticks (getconf CLK_TCK = 100) into percentages, and sampling with a Kotlin script; caveat: minimum sampling is 1s and top itself can consume ~23% CPU. FPS counting comes from running atrace and counting choreographer.doFrame calls (example device reports ~120 fps). The tool built is open source at flashlight.dev*.

AI-written summary · about

  1. 0:00Introduction
  2. 4:20Flashlight goals
  3. 5:23ADB for app performance
  4. 9:39CPU usage with top
  5. 12:48Performance tool challenges
  6. 13:51Android top implementation
  7. 18:06Linux /proc filesystem
  8. 22:25Shell to Kotlin
  9. 27:26Live CPU with Kotlin
  10. 31:02CPU usage accuracy
  11. 33:10FPS with atrace
  12. 38:25Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.