~/talk

Comparing DI frameworks & internals

Talkat Mobius 2017 Piter · 2017-04-21..04-22· [android, software-architecture]
slides:none on file

Deep dive comparing Dagger 2 vs Toothpick: Dagger uses annotation processing to generate a static compile-time graph with compile-time scope verification, which makes large graphs faster and errors caught at build time; Toothpick (released 2016, built in ~2 months) also avoids reflection but generates a dynamic runtime-backed graph, creates scopes fast (~1 ms vs ~20 ms for Dagger), and makes testing simple with a rule that swaps mocks. Reflection is the core problem (constructor creation ~100× slower); Toothpick wins for small-to-medium apps, Dagger for very large injection counts (≈1,000+).

AI-written summary · about

  1. 0:00Introduction
  2. 3:34Dependency injection overview
  3. 10:14History of DI libraries
  4. 16:38Reflection in Android
  5. 25:07Dagger vs Toothpick setup
  6. 30:02Scopes in DI frameworks
  7. 35:24Testing with DI frameworks
  8. 38:11Performance comparison
  9. 40:20How annotation processing works
  10. 45:40Code generation internals
  11. 51:01Alternatives to reflection
  12. 52:25Summary and conclusion
~/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.