Welcome back to our series dedicated to Building & Maintaining Great Mobile Apps. In Part 1 we defined the pillars of mobile excellence – Performance, Reliability, Adaptability, and Sustainability.
In Part 2 we start with the focus on the first pillar: Performance
Performance isn't a luxury; it's the foundation upon which every other aspect of the user experience rests.
Milliseconds matter - A delay of a few hundred milliseconds can be the difference between a fluid interaction and noticeable lag. Users perceive slow apps as low-quality, frustrating, and untrustworthy.
To put this in perspective, industry data shows just how unforgiving users are when it comes to performance:
- App load time longer than 2 seconds leads to higher abandonment rates.
- If your app takes more than five seconds to deliver content, you’re likely to lose that user to a competitor.
- Nearly 90% of users stop using apps due to poor performance—including slow loading, laggy interactions, and crashes.
Clearly, achieving high performance isn't just about technical pride; it's crucial for user retention and business success.
In this post, we dissect the Performance pillar: how to measure it, optimize it, and build a culture where speed and efficiency are paramount.
1. What Does "Good" Performance Actually Mean?
So, knowing performance is critical, but how do we define what "good" looks like in concrete terms? Defining performance requires moving beyond subjective and vague feelings to measurable Key Performance Indicators (KPIs), such as:
- Speed: How quickly does the app start? How fast do screens load? How long do critical user actions take?
- KPIs: Time To Initial Display, Time To Interactive, App Startup Time (Cold/Warm/Hot)
- Responsiveness: Does the UI react instantly to user input? Are animations smooth and jank-free?
- KPIs: 60 FPS, Dropped Frame Percentage, Main Thread Handoff Time
- Resource Usage: How much CPU, memory, and battery does the app consume during typical usage? Is data usage minimized, especially on mobile networks?
- KPIs: Average/Peak CPU Utilization %, Average/Peak Memory Footprint in MB, Network Data Usage in MB per session or per key flow, Battery Consumption Rate - % drop per hour or per key flow
- Footprint: What is the download and install size of the app? Smaller apps see better conversion rates and lower user friction.
- KPIs: Download Size in MB and Install Size in MB
Engineering teams must define targets for these KPIs based on user expectations and device capabilities, moving away from "it feels fast enough" towards objective, data-driven goals.
2. Performance as a Feature, Not an Afterthought
Transform "we should check performance" into "performance is checked automatically."
Performance shouldn't be an afterthought addressed only when problems arise, treat it as a core feature with dedicated processes:
- Establish Baselines: Define the key performance indicators (KPIs) for critical user flows
- For e.g., Time To Initial Display for the home screen < 1s
- P95 API latency for login < 500ms
- Max memory usage during core task < 200MB
- These aren't just vanity metrics, they are your contract with the user
- Automated Benchmarking: Integrate performance tests into your CI/CD pipeline to catch regressions early.
- Leverage frameworks like Android's Benchmark library or iOS's XCTMeasure within your existing UI test suites (Espresso, XCUITest etc)
- Focus on high-impact areas, such as app startup time (cold/warm), critical screen load times (e.g., product detail page, main feed), memory usage during a typical session, battery usage for specific background tasks that are frequent or long running.
- Configure your CI to run these benchmarks regularly – you can start with nightly builds or even on every pull request.
- Set thresholds. If startup time increases by >10% or memory usage spikes beyond your defined limit, the build should fail or trigger an immediate alert. This provides early detection, preventing regressions from silently creeping into the codebase before they impact users.
- Size Monitoring: Track app download and install size changes with every pull request or build using CI tooling. Set thresholds here too – a sudden 300kb increase should raise questions.
3. Leadership's Role: Championing a Performance-First Culture
Leadership commitment transforms performance from a technical task into a shared team value.
Integrating performance checks and tools is essential, but fostering a true performance-first culture requires active championship from leadership. Leaders must make performance non-negotiable
Champion the Definition of "Done":
Integrate performance checks and KPI adherence into the team's definition of "done" for features. Treat performance regressions with the same severity as functional bugs.
Acknowledge the Challenges (Why is this Hard?):
There's always high pressure to release new features quickly. Improving performance often doesn't look as exciting as a new design, so when deadlines are near, it's usually the first thing to get dropped.
Teams might not know how to use the performance tools well, or deciding on the right performance targets can seem difficult.
And sometimes, honestly, there's just no time kept aside for it.
Enable Success (How to Ensure It Happens):
- Keep Dedicated Time Aside: Make sure to set aside a fixed amount of time in every sprint (like 10-15%) only for checking performance, fixing issues, improving tools, and clearing up past performance problems. Protect this time; don't let it be used for other tasks.
- Make Checks Compulsory: Insist on seeing performance test results for any new code (in pull requests), especially if it changes important user journeys. Make it a regular practice to share the 'before and after' numbers with the team.
- Show the Numbers Openly: Report the key performance numbers (like startup time, screen loading time, app size) along with updates on feature delivery to the team and managers. Celebrate when performance gets better, and openly look into any drops in performance.
- Strictly Follow the 'Done' Rules: Give senior engineers or tech leads the authority to block code merges or releases if there are big drops in performance without a good reason. Don't just say performance is important, act like it is. If a performance problem does get released, make sure there's a plan to fix it quickly.
- Connect to Business Goals: Explain performance improvements using business results. "Reducing startup time by 300ms correlates with a 1% increase in session length," or "Fixing memory churn reduced crashes on low-end devices by 15%." This helps justify the investment to non-technical stakeholders.
4. Key strategies to ensure great Performance: An Engineer's Toolkit
Optimization without measurement is just guesswork.
Achieving performance requires both solid engineering habits and the use of profiling tools to uncover and fix issues. Here are some core techniques:
Code & Threading:
- Use efficient algorithms and data structures.
- Aggressively move non-UI work (I/O, computation, parsing) off the main thread using platform constructs (Coroutines, Grand Central Dispatch, Threads).
- Tools like Android Studio Profiler or Xcode Instruments are invaluable for pinpointing hotspots.
Network Optimization:
- Implement smart caching strategies (in-memory, disk) to avoid redundant fetches.
- Use efficient data formats (e.g., Protobuf over JSON).
- Compress payloads.
- Design APIs to fetch only necessary data.
- Handle slow/unreliable networks gracefully (timeouts, retries, offline modes). Utilize robust networking libraries (Retrofit, Alamofire) that facilitate this.
- Tools built into IDEs or proxies like Charles/Fiddler help visualize network traffic.
Memory Management:
- Be mindful of object lifecycles, especially in relation to contexts/views, to prevent leaks.
- Use efficient data structures for large collections.
- Leverage platform tools for leak detection (LeakCanary, Instruments).
- Tools like LeakCanary can help immensely to identify memory leaks.
App Size Reduction:
- Utilize platform optimizations (Android App Bundles, iOS App Thinning).
- Enable resource shrinking and code obfuscation/minification (R8/ProGuard).
- Analyze dependencies and remove unused libraries or code.
- Optimize image and asset sizes.
- 2. How to Be Objective: Measure, Profile & Optimize - An Engineer's Toolkit
Mastering these tools is essential for diagnosing complex performance issues. Regularly profiling key user flows should be standard practice.
5. Conclusion
A fast, responsive, and efficient mobile app feels inherently high-quality. It respects the user's time, device, and data plan, building trust and encouraging engagement.
Performance engineering isn't a one-time task but an ongoing discipline requiring measurement, specific techniques, and a cultural commitment from both engineers and leadership. By embedding performance focus into your development lifecycle, you build apps that don't just function, but delight!
Next, we'll tackle the pillar that ensures users can consistently rely on that delightful experience: Reliability. Stay tuned!