DEV Community

Cover image for Mobile Game Power Consumption Optimization: Building a Quantitative Analysis Workflow with Perfetto and Power Rails
GameOptim
GameOptim

Posted on

Mobile Game Power Consumption Optimization: Building a Quantitative Analysis Workflow with Perfetto and Power Rails

As mobile game content, gameplay systems, and rendering quality continue to evolve, power consumption optimization has become an increasingly important challenge for development teams.

Over the past year, we conducted extensive research and practical testing around game power consumption and gradually established a relatively quantifiable analysis methodology. The goal is not only to determine whether power consumption is increasing, but also to identify which hardware components or system modules are responsible for the increase.

This article focuses on the first stage of that methodology: selecting the right tools and building a reliable power analysis workflow.


The Challenge of Power Consumption Analysis

Many performance analysis tools can show that power consumption is rising during gameplay. However, they often fail to answer a more important question:

What is actually causing the increase?

For example:

  • Is the power increase caused by GPU workload?
  • Is CPU processing consuming more energy?
  • Is the display subsystem responsible?
  • Are other system components contributing significantly?

Without quantitative data, optimization efforts often rely on guesswork rather than evidence.

The goal of power analysis should be to identify the primary source of power pressure and prioritize optimization efforts accordingly.


Starting with Trend Monitoring

GOT Online

A traditional approach is to use GOT Online to observe overall power consumption trends during gameplay testing.

The tool provides a high-level view of power behavior, making it useful for detecting changes between builds or identifying problematic gameplay scenarios.

However, while it can reveal that power consumption has increased, it cannot explain why.


Gears

Gears also provides power consumption curves that allow developers to:

  • Observe overall power trends during testing
  • Compare different test scenarios
  • View average power consumption results

This makes it useful for measuring optimization effectiveness and tracking power-related regressions.

Like GOT Online, however, Gears primarily focuses on power trends rather than root-cause analysis.

It can indicate that power consumption increased, but it cannot directly identify whether the increase originated from GPU activity, CPU workload, or another subsystem.


Exploring Quantitative Power Analysis Tools

To move beyond trend monitoring, we evaluated several tools capable of providing more detailed power data.


Trepn Profiler

One of the first tools investigated was Trepn Profiler.

Based on its name and positioning, it appears to be designed for power-related analysis. However, practical testing revealed significant limitations.

The available data dimensions are relatively limited and primarily focus on frequency changes for a small number of CPU cores.

While this information can provide some insight into CPU behavior, it offers limited value for detailed power attribution.

As a result, this approach was eventually abandoned.


BatteryStats

The next tool evaluated was Android's BatteryStats, accessed through ADB command-line commands.

BatteryStats can collect power-related information based on process UID and provides metrics for multiple system components, including:

  • Screen
  • CPU
  • Audio
  • Video
  • Wi-Fi

After organizing and visualizing the collected data, it becomes possible to observe rough power consumption trends across different modules.

For example, steeper trend lines typically indicate higher power consumption within a specific subsystem.

Advantages

  • Supports multiple power-related subsystems
  • Provides process-level attribution
  • Useful for observing module-level trends

Limitations

Despite these advantages, BatteryStats remains relatively abstract.

It cannot accurately identify which application behaviors are responsible for CPU or GPU power increases, and some important power-related modules are not represented in sufficient detail.

For deeper analysis, additional tooling is required.


Power Rails: Hardware-Level Power Breakdown

A significant improvement came with the discovery of Android Studio's Power Rails functionality.

Power Rails provides a much more detailed breakdown of device power consumption, including:

  • CPU big cores
  • CPU middle cores
  • CPU little cores
  • GPU
  • Display

This hardware-level visibility allows developers to understand which processing units contribute most to overall power consumption.

For example:

  • High GPU power usage often indicates rendering-related optimization opportunities.
  • High CPU big-core power usage may suggest expensive gameplay logic, animation systems, UI updates, physics calculations, or loading operations.

Compared with BatteryStats, Power Rails provides a much clearer picture of actual hardware power distribution.


Limitations of Power Rails

Although Power Rails offers highly valuable data, it comes with several restrictions.

1. Google Pixel Device Requirement

Power Rails currently works only on supported Google Pixel devices.

2. Debuggable Application Requirement

The target application must be built as a debuggable version.

3. Limited Profiling Duration

Long profiling sessions can generate large volumes of data that become increasingly difficult to analyze.

These limitations reduce its practicality for certain production scenarios.


Perfetto: A Practical Solution for Long-Term Power Analysis

After evaluating multiple approaches, Perfetto became the recommended solution for power data collection.

Using the Perfetto web interface, developers can enable both:

  • Battery tracing
  • Power Rails tracing

This combination provides detailed power attribution while also supporting long-duration testing sessions.

For example, one-hour gameplay tests can be captured and analyzed effectively.

Although trace memory size is limited, allocating approximately 64 MB is generally sufficient for most power analysis scenarios.


Collecting Power Data with Perfetto

The basic workflow is straightforward.

Step 1: Connect the Device

Within the Perfetto interface:

  1. Select Record New Trace
  2. Choose WebUSB
  3. Click Connect New Device
  4. Select the connected phone

Once the status indicator turns green, the device connection is successfully established.


Step 2: Record Gameplay

  1. Click Start Tracing
  2. Execute the desired gameplay test
  3. Click Stop when testing is complete

The collected trace data can then be opened for analysis.


Step 3: Analyze Power Distribution

Within the analysis results, modules can be sorted by Average Power in descending order.

This immediately highlights the largest power consumers.

Examples include:

Scenario A: GPU Dominates Power Consumption

If GPU power usage is significantly higher than other modules, GPU optimization should become the primary focus.

Potential investigation areas may include:

  • Rendering workload
  • Shader complexity
  • Overdraw
  • Bandwidth pressure

Scenario B: CPU Big Cores Dominate Power Consumption

If CPU big cores consume the most power, optimization opportunities may exist in:

  • Gameplay logic
  • Animation systems
  • UI updates
  • Physics calculations
  • Asset loading workflows

This makes it possible to prioritize optimization work based on measured power impact rather than assumptions.


A Key Advantage of Perfetto

One of Perfetto's most valuable benefits is that the target application does not need to be debuggable.

This means that even production builds downloaded directly from app stores can be analyzed.

For teams investigating issues in released games, this significantly expands the range of scenarios that can be tested.


Current Limitation

Despite its advantages, Perfetto still inherits one important hardware limitation:

Power tracing currently requires Google Pixel devices.

For teams planning to establish a power optimization workflow, access to a compatible Pixel device remains an important prerequisite.


Conclusion

Power consumption optimization becomes far more effective when supported by quantitative data rather than high-level trends alone.

While tools such as GOT Online and Gears are useful for monitoring overall power behavior, identifying the root cause of power issues requires deeper visibility into hardware-level power distribution.

Among the tools evaluated:

  • GOT Online and Gears are suitable for trend monitoring.
  • Trepn Profiler provides limited analytical value.
  • BatteryStats offers basic module-level attribution.
  • Power Rails enables detailed hardware power breakdowns.
  • Perfetto combines detailed power tracing with long-duration recording and support for production applications, making it a practical choice for power consumption analysis.

By leveraging Perfetto and Power Rails data, developers can quickly determine whether power pressure originates from the GPU, CPU, display, or other components, enabling more targeted and efficient optimization efforts.

Top comments (0)