tutorials | game

Android Game Analysis with Arm Mobile Studio

writer img alt

Arm Developer

Game performance can vary between different Android devices, because they use different chipsets, and GPUs based on different Mali architectures. Your game may render at 60fps on a Galaxy S20+, but how will it perform on the Galaxy A51 5G? The A51 5G has good specs, but you may want to consider runtime changes based on the underlying hardware if your game is pushing the limits on flagship hardware. Similarly, you may need to optimize your game to run at lower frame rates on the Galaxy J and Galaxy M models, which are often found in emerging markets.

Players quickly lose interest in a game if they experience drops in frame rate, or slow load times. They won’t play your game on long journeys if it drains battery or overheats the device. To reliably deploy a game globally, and ensure a great user experience, you need to performance test on a wide range of Android devices.

The Arm Mobile Studio family of performance analysis tools provide games studios with a comprehensive game analysis workflow for Android, giving information and advice at appropriate levels of detail, for technical artists, graphics developers, performance analysts and project leaders.

 

Monitor CPU and GPU activity

Arm Streamline captures a comprehensive profile of your game running on an unrooted Android device, and visualizes the CPU and GPU performance counter activity as you run your test scenario. You can see exactly how the CPU and GPU workloads are handled by the device, which helps you locate problem areas that might explain frame rate drops or thermal problems.

 

However, spotting performance issues using Streamline can be time-consuming, unless you know exactly what you’re looking for. Your team may have varying levels of experience or expertise, so interpreting this data can be difficult.

Introducing Performance Advisor

Arm Performance Advisor is a lightweight reporting tool that transforms a Streamline capture into a simple report that describes how your game performed on the device, and alerts you to problem areas that you should consider optimizing. It can be used by your whole team on a regular basis, to spot trends and diagnose problems early in the development cycle, when you’re best placed to do something about it.

 

Performance Advisor reports the application frame rate, CPU load and GPU load, as well as content metrics about the workload running on the Mali GPU. If it detects problematic areas, Performance Advisor tells you whether it’s the CPU or GPU that is struggling to process your application, and links to optimization advice to help you rectify it.

 

A frame rate analysis chart shows how the application performed over time. The background color of the chart indicates how the game performed. When you’re hitting your target frame rate, the chart background is green. In this example, most of the chart is blue, telling us the GPU in the device is struggling to process fragment workloads.

 

Performance Advisor can capture screenshots of your game, at the point that FPS drops below a given threshold. This helps you to identify which content might be causing the problem. This provides valuable context when debugging and can allow some common elements to be spotted if repeated slowdowns occur. You can then investigate these frames more closely with Graphics Analyzer, to see exactly which graphics API calls were executing at that point.

If you want to separately evaluate how different parts of the game performed, for example, loading screens, menu selection, and different levels or gameplay scenarios, you can annotate these regions in your game so that Performance Advisor can report data for them independently.

Performance budgeting

Because they have different performance expectations, it’s a good idea to set your own performance budgets for each device. For example, if you know the top frequency for the GPU in the device, and you have a target frame rate, you can calculate the absolute limit of GPU cost per frame.

GPU cost per frame = GPU top frequency / Target frame rate

When you generate a report with Performance Advisor, you can pass in your performance budgets, which are then shown in the charts, so you can easily see if you’ve broken one.

 

In the example below, we can see correlation between high numbers of execution engine cycles and drops in FPS. Performance Advisor tells us that the GPU is busy with arithmetic operations, and that the shaders could be too complex. The report provides a link to an advice page on the Arm Developer website, that explains how to reduce arithmetic load in shaders.

 

More charts include key performance metrics such as CPU cycles per frame and GPU bandwidth per frame, reported for read and write access. There are also charts showing the content workload , draw calls, primitives and pixels per frame, and the level of overdraw per pixel.

Download an example Performance Advisor report

Automated performance analysis

It’s far easier to fix problems as they arise than is it to patch problems later on. Performance Advisor’s key application performance metrics are useful to monitor over daily runs, to see how changes to your application affect performance during development.

 

Arm Mobile Studio Professional includes headless CI support - so you can easily deploy large-scale automated performance testing across multiple devices. Using a device farm with a CI workflow, you can generate performance data and optimization advice automatically, every night, for several Android devices. As you check in code, you can easily monitor how your content performs against your performance budgets over time, and raise alerts when you start to approach or break those budgets.

The Professional Edition also enables you to build bespoke data dashboards from the data that been collected. Performance Advisor's machine-readable JSON reports can be imported into any JSON-compatible database and visualization platform, such as the ELK stack. Compare metrics between test runs to quickly determine which changes impacted performance, and which type of workload is the likely cause for a regression. Query the data and compare performance against specific targets to identify optimization next steps.

Read more about how to integrate Arm Mobile Studio into a CI workflow on the Arm Developer website.

Resources

Arm publishes various resources on their developer website, to help you optimize performance:

Get Arm Mobile Studio

Arm Mobile Studio is free to use for interactive performance analysis. To use it headlessly in your CI workflow, you need an Arm Mobile Studio Professional license.

Download Arm Mobile Studio