Unit 02 of 03
Performance and Debugging
Cold, warm and hot starts, the causes of dropped frames, leak detection and memory profiling, measuring network and battery use, benchmarking that catches performance regressions, and code shrinking and obfuscation.
Published Updated
Lessons
- 01 Startup Time Cold, warm and hot starts do different amounts of work before the first frame. The lesson measures in how many of eight launches the first-frame budget is exceeded, and shows that one piece of work yields two overruns under two budgets and that deferred work does not disappear. 15 min read
- 02 Rendering Smoothness Smooth scrolling depends on every frame staying within its budget. The lesson measures a scrolled list in which every frame recreates all the items, shows how a stable key narrows the recreated work, and shows why the rule does not see the size of an overrun. 15 min read
- 03 Memory Management A screen that stays in memory after it closes is a memory leak. The lesson measures a listener that is never unregistered and holds one screen per cycle, in how many cycles the retained objects exceed the budget, and how the same leak changes category with the budget. 12 min read
- 04 Network and Battery Profiling The number of requests sent in a synchronization cycle determines battery and network use. The lesson measures sending requests one by one, in batches and by polling on the same stream of changes, and shows that polling exceeds the budget even in cycles without changes. 14 min read
- 05 Benchmarking Comparing two versions of a piece of work requires repeating the measurement. The lesson measures how warm-up iterations distort the measurement, how a regression looks once they are dropped, and how the rule misses it when the budget is chosen wider than the regression. 14 min read
- 06 Code Shrinking and Obfuscation Unused classes are stripped from the published app package and the names of the remaining classes are shortened. The lesson measures in how many modules the remaining class count exceeds the budget after shrinking, shows that obfuscation does not change this count, and shows that a broad keep rule defeats shrinking. 14 min read