1 of 11

Performance Optimization Opportunities in the Android Software Stack

Varun Gohil, Nisarg Ujjainkar+, Joycee Mekie+, Manu Awasthi

Ashoka University, +IIT Gandhinagar

Bench ‘21

Paper ID 20

2 of 11

Key Takeaways

For most Android apps:

  • System thread involved in frame rendering (RenderThread) is the most time-consuming thread

  • Group of threads responsible for IPC consume a bulk of the time in app’s execution

2

3 of 11

Motivation

3

This Photo by Unknown Author is licensed under CC BY-SA-NC

  • Android based smartphones : >70% market share; billions of users worldwide
  • Complex architectures: CPU, GPU, specialized compute blocks etc.
  • Yearly Android release cycles, with major enhancements
  • Rapidly evolving app ecosystem will rich features

Performance optimization opportunities in the software stack!

4 of 11

This Paper

  • Questions we try to answer:
    • Which are the most time-consuming threads per app?
    • Common threads across a cross section of apps that end up consuming the most time?
    • Which threads take up the most time during app launch?

  • Questions we do not answer
    • Propose and evaluate performance optimizations for identified bottlenecks

4

5 of 11

Experimental Methodology

  • 11 apps with Regions of Interest (RoI)
  • System level tracing with Systrace
  • Tracing during app launch and RoI activities
  • Postprocessing traces for analysis, binning and visualization creation

5

Experimental Smartphone

Apps and Regions of Interest

6 of 11

Binning Treads

Binning of threads by functionality helps make information useful

6

Google Chrome’s RoI (scrolling) trace lists several disparate threads

Combining Threads into bins provides potential targets for performance optimization

7 of 11

Per App Analysis - RoI

7

Frame Rendering and IPC are the most time-consuming bins per ROI

8 of 11

Per App Analysis – App Launch

8

Frame Rendering and IPC are the most time-consuming bins in app launch

9 of 11

Top Time-Consuming Threads

  • RenderThread offloads the rendering tasks to GPU from the UiThread, to maintain the smoothness of animations by avoiding frame drops (Frame Rendering)
  • surfaceflinger thread takes in multiple items from various graphics buffers and composes them into a single buffer which is then sent to the user display (Frame Rendering)
  • Binder communication within application processes and within framework and application processes (IPC)
  • HwBinder communication between framework and vendor processes (IPC)

9

10 of 11

Limitations and Future Work

  • Our analysis is currently limited to Android 9
  • Performance analysis tools are severely lacking for Android + Arm ecosystem
  • Time series analysis across Android versions not possible due to tool incompatibility across versions
  • Future work aims to
    • point out exact subsystems for targeted performance optimizations
    • Propose and evaluate optimizations to targeted subsystems

10

11 of 11

Key Takeaways

For most Android apps:

  • System thread involved in frame rendering (RenderThread) is the most time-consuming thread

  • Group of threads responsible for IPC consume a bulk of the time in app’s execution

11

https://tinyurl.com/Bench21Paper

Read

Contact