majorsenior2025

Reddit Android

The Unoptimized Binary

Reddit's Android app was 40% slower to start and generating 30% more ANRs than it had to be. The fix took two weeks. The cause: one missing Gradle flag.

The Incident

Reddit's Android team used Google Play's App Performance Score to surface a gap between their current metrics and what was achievable. Cold start was 40% slower than it should be. ANR rate was 30% elevated. Frame rendering had 25% more jank than necessary. And the app binary was 14% larger than it needed to be. All four problems shared one root cause — discoverable in two minutes of reading the build configuration.

Evidence from the Scene

  • App Performance Score showed 'significant improvement potential' across all four key metrics
  • Cold start on mid-range devices was consistently 40% above benchmark
  • ANR rate was 30% higher than comparable apps in the category
  • Binary size was 14% larger than competing apps with similar functionality
  • Build logs showed R8 was running but not in full optimization mode
  • Performance improved dramatically in a local test build with a single Gradle change

The Suspects

1 of these are the real root causes. The others are plausible-sounding distractors.

R8 full mode not enabled — no method inlining, class merging, or dead code elimination

No Baseline Profiles — JIT compilation adding overhead to every new install

Missing ProGuard consumer rules causing runtime crashes in release builds

Missing multidex configuration causing slow dex loading on API 20 and below

Release build accidentally including debug symbols and logging code

The Verdict

Real Root Causes

  • R8 full mode not enabled — no method inlining, class merging, or dead code elimination

    R8 full mode enables aggressive optimizations: dead code elimination, method inlining, class merging, and code compaction. Without it, unused code from dependencies survives in the binary, the APK is larger, and the JIT has more code to compile at runtime — producing slower startup, more JIT-induced frame drops, and elevated ANRs. Enabling it with minifyEnabled = true and shrinkResources = true fixed all four metrics.

Plausible But Wrong

  • No Baseline Profiles — JIT compilation adding overhead to every new install

    Baseline Profiles were also applied as part of Reddit's optimization work (published separately, December 2024, delivering 51% startup improvement in benchmarks). But the dominant cause of all four regressions — startup, ANR, frames, and binary size — was R8 full mode being disabled.

  • Missing ProGuard consumer rules causing runtime crashes in release builds

    Missing keep rules cause crashes after obfuscation — a different failure mode than the consistent performance degradation described. The clues show degraded metrics, not random crashes.

  • Missing multidex configuration causing slow dex loading on API 20 and below

    Multidex issues affect very old API levels (below 21) which represent a negligible fraction of modern Android users. The performance gap described here is across a wide device range, not just ancient hardware.

  • Release build accidentally including debug symbols and logging code

    Debug symbols increase binary size and logging adds overhead — but these produce gradual degradation, not the sharp 40% startup gap and 30% ANR elevation described here.

Summary

Reddit's four-metric performance gap — startup, ANR rate, frame rendering, jank, binary size — all traced back to a single missing Gradle configuration: R8 full mode was not enabled. Enabling minifyEnabled = true and shrinkResources = true with correct keep rules fixed all four simultaneously: 40% faster cold start, 30% fewer ANRs, 25% better frame rendering, 14% smaller binary. Implementation took under two weeks. Reddit also applied Baseline Profiles in a parallel track for an additional 51% startup improvement in benchmarks. Published by Android Developers in November 2025.

The Real Decision That Caused This

Not enabling R8 full mode — leaving aggressive code shrinking, method inlining, and class merging disabled in production builds, and not validating the build configuration against performance benchmarks.

Lesson Hint

Chapter 7 (Platform & Performance) covers R8, ProGuard, Baseline Profiles, and build optimization. Chapter 9 (Quality & Reliability) covers Android Vitals, ANR rate thresholds, and App Performance Score.

Want to test yourself before reading the verdict?

Open Interactive Case in Autopsy Lab