Skip to main content
Engineering

How Uber Deals with Large iOS App Size

26 February 2021 / Global
Featured image for How Uber Deals with Large iOS App Size
Figure 1: The default iOS build pipeline.
Figure 2: An example of profitably outlining a short, 2-instruction sequence ending with a call instruction. The outlined function exploits the tail call optimization.
Figure 3: Each point on the x-axis (log scale) is an instruction sequence pattern ordered (high to low) by its frequency of repeats. The number of candidates per pattern (blue line) follows a power-law curve with a long tail. The red line plots the sequence length for each pattern.
Figure 4: The fractal nature of the sequence length of repeating instructions; at very high repeat counts, the sequences are of short length; low repeat counts offer a wide variety of sequence lengths, and there are more unique sequences of shorter lengths.
Figure 5: The x-axis is sorted by the patterns with highest to lowest repeat frequency, y-axis is the cumulative savings possible. Numerous (> 100K) patterns should be outlined to gain most of the savings.
Figure 6: The new build pipeline for exploiting whole-program optimizations in iOS apps.
Figure 7: A demonstration of the suboptimality of greedy outlining and the superiority of repeated outlining.
Figure 8: The blue line shows the code size growth had we not applied any of the optimizations discussed in this paper. The red line shows the effects of our size reduction optimizations: notably, first, we reduced the code size by 23%, but second, and more importantly, we reduced the rate of code size growth by ∼ 2x.
Figure 9: Comparison of size reduction (a) code section vs. full app binary, (b) different rounds of machine outlining repeats, and (c) whole-program vs. intra-module machine outlining.
Figure 10: Performance comparison of five rounds of machine-code outlining in the new build pipeline against the default iOS build pipeline. A cell with a red tinge indicates performance improvements (favorable).
Milind Chabbi

Milind Chabbi

Milind Chabbi is a Staff Researcher in the Programming Systems Research team at Uber. He leads research initiatives across Uber in the areas of compiler optimizations, high-performance parallel computing, synchronization techniques, and performance analysis tools to make large, complex computing systems reliable and efficient.

Jin Lin

Jin Lin

Jin Lin is a senior software engineer in the programming systems group at Uber. He currently works in the area of LLVM and Swift compiler optimizations for code size and performance. In the past he has worked on optimizing compilers and runtime libraries.

Raj Barik

Raj Barik

Raj Barik is a former Principal Engineer and TLM in the Programming Systems group at Uber. He led the Programming Systems group and delivered a number of impactful program analysis tools to reduce infrastructure cost, improve code quality, and increase developer velocity. His broad research interests include Programming Languages, Program analysis, Compilers, and Performance optimization tooling.

Posted by Milind Chabbi, Jin Lin, Raj Barik

Category: