~/talk

The ViewModel Performance Trap:When State Management Bites Back

Talkat droidcon Berlin 2025 · 2025-09-24..09-26· [android]
slides:none on file

Shows that ViewModel construction often blocks the main thread long enough to break rendering — >16 ms causes jank, >500 ms can freeze or ANR — and traces reveal expensive injections like JSON builder and Retrofit setup created eagerly. Recommends measuring with method traces and Perfetto, making heavy deps singletons or warmed-up, avoiding blanket lazying, and supplying an injectable CoroutineScope using IO + supervisor job so init work runs off-main. At scale (close to 100 features, ~1,000 devs) a singleton warm-up + repository-level dispatcher boundaries proved effective.

AI-written summary · about

  1. 0:00ViewModel performance issues
  2. 5:23ViewModel creation slowness
  3. 10:02Measuring ViewModel traces
  4. 14:55Architecture solutions for slowness
  5. 17:47Init blocks problem
  6. 22:43Dispatcher switching in scope
  7. 27:45Customizing ViewModel scope
  8. 29:29Cold vs eager loading
  9. 33:24Changing dispatchers in architecture
  10. 36:12ViewModel responsibilities
  11. 39:21UI model provider
  12. 40:46Performance checklist
  13. 43:37Q&A
~/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.