Mobile Application Development

Monzo Optimizes Mobile Performance with R8 and Baseline Profiles to Achieve Substantial Reductions in App Latency and Crash Rates

Monzo, the United Kingdom’s premier digital-only bank, has announced a significant breakthrough in its mobile application performance, reporting a 35% reduction in "Application Not Responding" (ANR) incidents and dramatic improvements in interface fluidity. As the institution scales to serve more than 15 million customers, its engineering team has successfully leveraged advanced Android build-tooling—specifically R8 optimization and Baseline Profiles—to streamline the user experience without necessitating a fundamental rewrite of the application’s underlying codebase. This technical evolution marks a pivotal moment for the fintech giant, demonstrating that strategic refinements to build configurations can yield performance dividends comparable to major architectural overhauls.

The Scaling Challenge in Digital Banking

Since its inception in 2015, Monzo has transitioned from a niche "challenger bank" to a systemic financial institution. With this growth came an increasingly complex codebase. For a digital-only bank, the mobile app is not merely a tool but the entire storefront. Any friction in the app—whether a slow startup time or a stuttering transaction feed—directly impacts customer trust and operational efficiency.

As the Monzo engineering team monitored their metrics, they identified app startup time and UI responsiveness as critical areas for improvement. In the competitive landscape of UK fintech, where Monzo competes with rivals like Revolut and Starling, technical performance is a primary differentiator. The challenge facing the developers was how to optimize a massive, multi-module Android project without halting the delivery of new financial features or introducing regressions into the highly sensitive banking environment.

The Technical Pivot: R8 Optimization and Full Mode

The first major pillar of Monzo’s performance strategy involved a deeper utilization of R8, Android’s default tool for shrinking, obfuscating, and optimizing code. While many developers use R8 in its basic capacity to reduce APK size, Monzo discovered that their configuration was utilizing an outdated default that effectively hamstrung the tool’s potential.

Monzo boosts performance metrics by up to 35% with a simple R8 update

Historically, many Android projects have relied on the standard proguard-android.txt configuration file. However, this legacy configuration often includes the -dontoptimize instruction, which prevents the R8 compiler from performing advanced code analysis and restructuring. By transitioning to proguard-android-optimize.txt, Monzo enabled R8 "full mode." This shift allowed the compiler to perform more aggressive optimizations, such as inlining methods, removing unused arguments, and simplifying class hierarchies.

The impact of this single configuration change was immediate and measurable. By allowing R8 to properly optimize the bytecode, the app became leaner and more efficient at execution. The most notable metric was the 35% reduction in ANR rates. ANRs typically occur when the main UI thread is blocked for too long, often due to heavy processing or inefficient class loading during startup. By optimizing the code paths and reducing the total amount of code the Android Runtime (ART) needs to process, Monzo successfully cleared these bottlenecks.

Implementing Baseline Profiles for Fluid Interaction

Beyond startup times, the Monzo team focused on "jank"—the visual stuttering that occurs when the app fails to render frames at the required refresh rate. This is particularly noticeable in a banking app when a user is scrolling through months of transaction history. To combat this, Monzo implemented Baseline Profiles.

Baseline Profiles are a mechanism that allows developers to provide the Android build system with a list of critical code paths—such as those used during app startup or when scrolling the main feed. On the user’s device, the Android Runtime uses this profile to pre-compile these specific paths into machine code before the app is even launched. This "Ahead-of-Time" (AOT) compilation bypasses the slower "Just-in-Time" (JIT) compilation that usually occurs when a user first interacts with a feature.

Monzo specifically targeted their main account feed for this optimization. The results were statistically profound:

Monzo boosts performance metrics by up to 35% with a simple R8 update
  • P90 Scroll Performance: Improved by 71%, meaning that for 90% of users, the scrolling experience became significantly smoother.
  • P95 Scroll Performance: Improved by 87%, nearly eliminating the worst-case stuttering scenarios for the vast majority of the user base.

Chronology of Implementation and Automation

The transition to a high-performance build was not a one-time event but a process of incremental integration. The engineering team followed a structured timeline to ensure stability:

  1. Audit Phase: The team audited their existing ProGuard/R8 "Keep Rules." These rules prevent the compiler from removing code that is accessed via reflection. Over years of development, these rules often accumulate "bloat," where code is kept unnecessarily, limiting the compiler’s ability to optimize.
  2. Configuration Shift: The team replaced proguard-android.txt with proguard-android-optimize.txt. This was initially tested in internal "nightly" builds to monitor for any crashes related to overly aggressive optimization.
  3. Baseline Profile Integration: Monzo developed a strategy to keep their Baseline Profiles current. Rather than manual updates, they integrated profile generation into their continuous integration (CI) pipeline.
  4. Automation: Neumayer, a lead engineer on the project, noted that the team now triggers baseline profile generation every weekday before running nightly builds. The updated profiles are automatically committed to the repository, ensuring that every release contains the most recent performance maps.

Managing Technical Debt through Documentation

A common pitfall in Android development is the mismanagement of "Keep Rules." When a developer is unsure why a specific class is being stripped by R8, the temptation is to add a broad "keep" rule that remains in the codebase forever. Monzo addressed this by enforcing a strict documentation policy.

"We always add a comment explaining why Keep Rules are in place, so we know when it’s safe to remove the rules," Neumayer explained. This practice ensures that as the app evolves and old libraries are removed, the corresponding R8 rules are also purged, maintaining the efficiency of the optimization process. This level of hygiene is what allowed Monzo to transition to R8 full mode with minimal friction compared to legacy apps that often struggle with complex, undocumented reflection usage.

Broader Implications for the Mobile Industry

Monzo’s success story serves as a case study for the broader mobile development community. It highlights a shift in industry standards where "optimizing for the platform" is becoming as important as "building features." As mobile hardware becomes more diverse—ranging from high-end flagship devices to budget handsets—the ability of an app to perform efficiently across the entire spectrum is vital for inclusive growth.

The 35% reduction in ANRs is particularly significant for user retention. Industry data suggests that a high ANR rate is one of the leading causes of app uninstalls and negative Play Store reviews. For a bank, an unresponsive app can lead to customer anxiety during time-sensitive transactions. By prioritizing these "under-the-hood" improvements, Monzo is effectively strengthening its brand reliability.

Monzo boosts performance metrics by up to 35% with a simple R8 update

Furthermore, Monzo’s approach demonstrates that high-impact performance gains do not always require thousands of man-hours of refactoring. By staying current with Google’s recommendations for the Android Gradle Plugin (AGP) and R8, the team was able to unlock latent performance already available within the modern Android ecosystem.

Conclusion and Future Outlook

The engineering philosophy at Monzo continues to emphasize regular alignment with modern development standards. Neumayer’s advice to other engineering teams is clear: regularly check practices against current Google recommendations. The landscape of Android compilation and execution is moving away from the legacy ProGuard era toward a more integrated, intelligent optimization model with R8 and ART.

As Monzo continues to expand its feature set—including recent forays into investments, subscriptions, and advanced security features—the foundation of a high-performance, optimized build will be essential. The institution has proven that even at the scale of 15 million users, agility can be maintained by embracing the full potential of the developer tools at hand. For the wider fintech and app development sectors, the Monzo model provides a blueprint for scaling gracefully while maintaining a premium, responsive user experience.

Developers looking to replicate Monzo’s success are encouraged to explore the official R8 documentation and consider the implementation of Baseline Profiles as a standard part of their release lifecycle. As mobile ecosystems evolve, the margin for performance error narrows, making the strategies employed by Monzo not just "best practices," but requirements for market leadership.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button