Use Android text like a pro
summary
A feed layout measures at about 4.6 ms where text consumes ~98% of that time; simply disabling hyphenation cuts measurement time roughly in half without visible UI change. Using PrecomputedText moves shaping to a background thread and drops a 4 ms cost to ~0.2 ms (~20× speedup), but native word caches use memory (roughly 20 KB per 500 chars) and PrecomputedText is immutable. Use RecyclerView prefetch with PrecomputedText to precompute text off‑thread and speed up scrolling.
AI-written summary · about
chapters (8)
- 0:00Start
- 2:23(text / linearlayout) %
- 2:55LinearLayout vs Text
- 3:0598% time for text
- 3:27Hyphenation disabled
- 4:31Questions
- 6:23What does it do?
- 7:25Background measurement
related talks
37mAndroid Text, The Good The Bad and The ugly
43mBest Practice for Text on Android and Its Internals
35mBest practices for text on Android
36mBest practices for using text in Android
46mTypesetting: designing and building beautiful text layouts
39mView performance deep dive
41mAndroid Textual Layout
34mFlat as a pancake
