Developer and User-Transparent Compiler Optimization for Interactive Applications

Paschalis Mpeis, Pavlos Petoumenos§, Kim Hazelwood, Hugh Leather

University of Edinburgh, University of Manchester§, Facebook AI Research




PLDI'21

Anywhere on earth


Chat with us @PLDI:

Citation:

@inproceedings{mpeis2021developer,
  title={Developer and User-Transparent Compiler Optimization for Interactive Applications},
  author={Mpeis, Paschalis and Petoumenos, Pavlos and Hazelwood, Kim and Leather, Hugh},
  booktitle={42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation},
  year={2021},
  organization={ACM Digital Library}
}

1. Transparent online captures

Initially we detect Android-code regions that can be accurately replayed and worth optimizing. On subsequent invocations, we transparently capture real user inputs for them.

2. Offline replays

Then, we use offline replays as a means of evaluating different code transformations on the captured input. Our replay mechanism works in the presence of memory-shuffling security mechanisms. By executing this offline we can hide crashes or slow evaluations from the users, and perform dynamic profiling for futher optimization, through interpretation, that would have been too costly to do online.

Replay-based iterative compilation

By fusing the replay-based evaluation mechanism with iterative compilation, we are able to identify better optimization flags to compile an application for a particular input, without experimenting directly on the users. We evaluate each flag by replaying the real-user inputs we captured earlier. This ensures that our comparisons are sound and that our findings are representative of real user usage. With our novel LLVM Backend for the Android compiler we significantly increase the optimization space for Android applications. Once a mobile device becomes idle and charged, we search through this now-huge space using a genetic algorithm.

Results

Unnoticeable online operation

By reporposing kernel mechanisms, our infrequent captures remain unnoticeable by the users.

Small storage footprint

We can easily fit multiple captures of different applications even on low-end devices.

Performance improvements

For the above, almost imperceptible overheads, we achieve impressive results!

Contact

Source Code