MobileLab: Highly accurate testing to prevent mobile performance regressions

Early in our mobile optimization efforts, each fix meant big leaps in performance improvement. Today, our apps are optimized so much that our time is best spent preventing tiny regressions that, if…

Joel Beales
12 min readadvanced
--
View Original

Overview

MobileLab is a new system developed by Facebook to prevent mobile performance regressions by detecting small changes in performance metrics. It improves confidence intervals by 7x and reduces false positives by 75%, allowing for more accurate testing in a highly optimized environment.

What You'll Learn

1

How to establish a validation framework for performance testing

2

Why eliminating variance is crucial for accurate performance metrics

3

How to implement consistent application performance testing using MobileLab

4

When to use automated regression detection in a CI/CD pipeline

Prerequisites & Requirements

  • Understanding of performance testing concepts
  • Familiarity with Android development and testing tools(optional)

Key Questions Answered

How does MobileLab improve performance testing accuracy?
MobileLab improves performance testing accuracy by allowing detection of performance regressions as small as 1 percent. It achieves this by enhancing confidence intervals by 7x and reducing false positives by 75%, making it a reliable tool for performance teams.
What steps are taken to eliminate variance in performance testing?
To eliminate variance, MobileLab uses consistent device performance by locking CPU and GPU frequencies, creating a controlled testing environment. It also employs an HTTP proxy server to reduce external noise and backs up application state to ensure consistency across trials.
What is the role of automated regression detection in MobileLab?
Automated regression detection in MobileLab continuously compares the current production branch to the master, identifying performance regressions and alerting engineers about issues. This process is crucial for maintaining app performance and ensuring timely fixes before releases.
When should performance benchmarks be run in MobileLab?
Performance benchmarks in MobileLab should be run continuously, especially when new device models are added or changes are made to the codebase. This ensures that any regressions are caught early and do not reach production.

Key Statistics & Figures

Confidence interval improvement
7x
This improvement allows for more reliable detection of performance regressions.
Reduction in false positives
75%
This significant reduction enhances the accuracy of performance testing.
Minimum detectable regression
1%
MobileLab can detect performance regressions as small as this percentage.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Tool
Profilo
Used for tracing and understanding performance differences in the system.
Technology
Graphql
Utilized for fetching data from Facebook's servers, affecting application performance.

Key Actionable Insights

1
Implement a validation framework to quickly assess performance changes in your applications.
This framework allows you to run controlled experiments and accurately measure performance regressions, which is essential for maintaining high-quality mobile applications.
2
Lock CPU and GPU frequencies during performance testing to reduce variance.
By stabilizing device performance, you can achieve more consistent results, making it easier to identify true regressions rather than fluctuations caused by hardware variability.
3
Utilize an HTTP proxy server to eliminate external factors affecting performance metrics.
This approach helps in isolating your tests from network variability, ensuring that your benchmarks reflect the application's performance rather than external influences.
4
Automate regression detection as part of your CI/CD pipeline.
This practice ensures that any performance issues are identified and addressed before they reach production, maintaining the integrity of your application’s performance.

Common Pitfalls

1
Failing to control external variables can lead to inaccurate performance metrics.
Without isolating your tests from network variability and device performance fluctuations, you may misinterpret the results of your benchmarks.
2
Overlooking the importance of application state management between trials.
Not resetting the application state can introduce inconsistencies in performance testing, leading to unreliable results.

Related Concepts

Performance Testing Methodologies
Statistical Analysis In Testing
CI/CD Best Practices