[Paper Review] Iterative compilation on mobile devices
This paper proposes an iterative compilation framework for mobile devices that uses a lightweight, function-level capture and replay mechanism to enable offline evaluation of compiler optimizations using real user workloads. By capturing only the minimal memory state needed to replay heavily used functions, it achieves up to 57% performance improvement over the highest compiler optimization level, with an average user-facing slowdown of only 0.8%.
The abundance of poorly optimized mobile applications coupled with their increasing centrality in our digital lives make a framework for mobile app optimization an imperative. While tuning strategies for desktop and server applications have a long history, it is difficult to adapt them for use on mobile phones. Reference inputs which trigger behavior similar to a mobile application's typical are hard to construct. For many classes of applications the very concept of typical behavior is nonexistent, each user interacting with the application in very different ways. In contexts like this, optimization strategies need to evaluate their effectiveness against real user input, but doing so online runs the risk of user dissatisfaction when suboptimal optimizations are evaluated. In this paper we present an iterative compiler which employs a novel capture and replay technique in order to collect real user input and use it later to evaluate different transformations offline. The proposed mechanism identifies and stores only the set of memory pages needed to replay the most heavily used functions of the application. At idle periods, this minimal state is combined with different binaries of the application, each one build with different optimizations enabled. Replaying the targeted functions allows us to evaluate the effectiveness of each set of optimizations for the actual way the user interacts with the application. For the BEEBS benchmark suite, our approach was able to improve performance by up to 57%, while keeping the slowdown experienced by the user on average at 0.8%. By focusing only on heavily used functions, we are able to conserve storage space by between two and three orders of magnitude compared to typical capture and replay implementations.
Motivation & Objective
- Address the challenge of optimizing mobile applications that are poorly compiled and exhibit highly variable usage patterns.
- Overcome the limitations of online iterative compilation, which risks degrading user experience during optimization trials.
- Enable personalized, offline optimization of mobile apps using real user workloads collected during actual usage.
- Minimize runtime and storage overhead on mobile devices while preserving the ability to evaluate compiler transformations accurately.
- Develop a system that adapts to diverse mobile architectures and noisy runtime environments without compromising user experience.
Proposed method
- Capture only the minimal set of memory pages required to replay the most frequently executed functions during user interaction.
- Leverage existing Linux kernel mechanisms (e.g., cgroup memory controls) to efficiently isolate and copy the necessary runtime state.
- Store captured function states in a persistent, compact form to reduce storage by 2–3 orders of magnitude compared to full-system capture.
- Replay captured function states using a custom replay engine that executes transformed binaries under identical conditions.
- Integrate the replay system with an iterative compiler that evaluates multiple optimization sets offline during idle, charging periods.
- Use statistical analysis on replayed results to filter out noise from environmental variability and co-scheduled processes.
Experimental results
Research questions
- RQ1Can iterative compilation be effectively applied to mobile applications without degrading user experience?
- RQ2How can real user workloads be captured and replayed efficiently on mobile devices with limited resources?
- RQ3To what extent can function-level state capture reduce storage overhead compared to full-system capture?
- RQ4Can offline evaluation using replay achieve performance improvements comparable to online optimization with minimal user impact?
- RQ5How does the system handle runtime noise and variability in mobile environments during optimization evaluation?
Key findings
- The proposed capture mechanism introduces an average performance overhead of only 0.8% on the user’s device, making it imperceptible during normal use.
- The system achieves up to 57% performance improvement in hot functions compared to the highest optimization level of the Android compiler.
- Storage requirements are reduced by two to three orders of magnitude by capturing only the minimal state needed for replaying frequently executed functions.
- The replay mechanism introduces only 2.11 μs of additional latency per replayed function call, ensuring that evaluation results are representative of real-world performance.
- The offline evaluation process enables multiple optimization trials per single full application execution, significantly accelerating the search for optimal transformation sets.
- Performance gains observed during replay translate effectively to production execution, confirming the validity of the approach for real-world deployment.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.