Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Guidelines on How to Run a Basic Analysis for Android* Graphical Applications Using Intel® GPA tools

$
0
0

Introduction

In this article I’ll provide some simple steps on how to perform a basic analysis for Android* graphics applications using Intel® GPA tools. Most performance-sensitive graphic applications on Android are games, so I will assume that we’re optimizing a game.

Before you start the analysis you need a correctly working game. If you have graphic issues in your game consider using Intel® GPA Frame Debugger to debug and fix them. Intel® GPA Frame Debugger can help you identify rendering problems and track down errors quickly and easily.
So, let’s say that we have a correctly working game but the graphics performance is not good.

Before you perform any changes to the source code you will need to analyze the application by collecting several performance metrics. After that, you will need to compare the metrics before and after the code change. If you don’t have metrics it’s difficult to verify any difference after the optimization.
If your application is using NDK please check that you compile it for all relevant architectures. The easiest option is to set APP_ABI := all in Application.mk file. This could result in a bigger APK (Android application package) file but the game will be optimally compiled for all architectures supported by Android NDK.

To measure performance metrics you can use Intel® GPA System Analyzer.


Intel® GPA System Analyzer

Intel® GPA System Analyzer

Intel® GPA System Analyzer for Android is intended for optimizing OpenGL ES games. When connected to an Android device, the System Analyzer provides OpenGL ES API, CPU, and GPU performance metrics, as well as multiple graphics pipeline state overrides that can help you analyze OpenGL ES performance.

To prepare the game for analysis using the Intel® GPA System Analyzer:

  1. Open the AndroidManifest.xml file
  2. Add the Internet permission: 
    <uses-permission android:name="android.permission.INTERNET" />
  3. Set the debuggable flag to “true”:
    <application android:debuggable="true">
  4. Rebuild and install the APK file.

The first metric we will use to analyze graphics performance is Frames Per Second (FPS). The FPS metric can change from 0 to V-Sync if vertical synchronization is enabled.

There are two optimization goals:

  • Increase the average FPS value
  • Minimize the FPS dispersion

If the FPS value is low for the graphics application it will result in visual slowness. The typical value for graphics performance that is rated as “good” is more than 30 fps. The ideal value is V-Sync (typically ~60 fps).

If the FPS value dispersion is high it will result in lags.

In an ideal situation the FPS value is constant and equal to V-Sync. In this case graphics performance is optimal. However, we also need to optimize power efficiency. The main goal for this is to minimize the “Frame Time” metric and to measure CPU frequency, GPU frequency and power consumption.

What are the next steps if graphics performance is not ideal? We need to determine what is limiting the FPS. There are three typical sources: CPU-bound applications, GPU-bound applications and Mixed. Of course, an application could be slow due to network conditions, disk IO or other aspects but these are not the typical situations for a game.


CPU-bound Application

How do you detect that the application is CPU-bound?

Use the frequency adjustment control (available with rooted Android devices) in Intel® GPA System Analyzer and check how the frequency change affects the FPS. If the FPS drops and frequency is low or if it rises and the frequency is high then the application is CPU-bound.
How to optimize CPU-bound applications:    

  1. Use Intel® C++ Compiler for Android to produce optimized binaries for Intel® Architecture.
  2. Find the hotspots using Intel® V-Tune Amplifier
  3. Use common optimizations technics like multi-threading and vectorization.

GPU-bound Application

How do you detect that the application is GPU-bound?

State Overrides

Use the «State Overrides» feature of Intel® GPA System Analyzer. Enable “Disable Draw Calls” override and check how it will affect the FPS value. If the FPS value rises with “Disable Draw Calls” override then the application is GPU-bound.

  1. Try to find a GPU module that affects the performance by simplifying the graphics workload using the System Analyzer “State Overrides” feature.
  2. Use the Intel® GPA Frame Analyzer tool to deeply analyze the specific frame and check how each draw call affects the performance and try some experiments.

Mixed CPU/GPU bound Application

In most cases an application has  CPU and GPU parts and both of them affect FPS. To fully analyze how these parts interact with each other you can use the Intel® GPA Platform Analyzer (part of the Intel GPA suite).

Multiple Devices

Typically a game needs to be optimized for many devices. The Intel® GPA Console Tool can be useful to automatically track the performance metrics on many devices. It’s possible to develop a representative game demo and automatically track the performance on a regular basis. This topic is covered in the article “Using Intel® Graphics Performance Analyzers Console Client for Android* Application Performance Analysis”.

Conclusion

When you analyze the performance of a graphics application it’s very important to collect some measurable metrics. It’s easy to check the effectiveness of a particular optimization then you have metrics. Conversely, it’s very hard to compare optimizations by visual comparison of application versions.

The Intel® GPA System Analyzer delivers the ability to display multiple metrics at the same time. It also provides features to do some basic experiments like CPU frequency adjustments and State Overrides. These experiments can help you to determine what part you need to optimize.

Intel® V-Tune Amplifier tool will help you analyze the CPU performance of your applications.

Intel® Frame Analyzer will help you to understand the performance details of one particular frame and how each draw call affects the final image and performance.


Other Related Articles and Resources

 

 


Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>