OnQ Blog

Profiling VR apps for better performance

Qualcomm products mentioned within this post are offered by Qualcomm Technologies, Inc. and/or its subsidiaries.

High performance in virtual reality apps is important to users, but we developers need to be smart about how we deliver it.

Does it surprise you to learn that 96% of mobile users consider performance important? If it’s that important to users, then it should be that important to us. Even if performance isn’t our highest priority, as developers we have a responsibility to make sure we’re not running pesky background services and draining the battery needlessly. And as VR hardware becomes more accessible, our apps shouldn’t cause a headset to overheat.

Qualcomm® Snapdragon™ Profiler allows you to analyze CPU, GPU, DSP, memory, power, thermal and network data so you can find and fix the performance bottlenecks in your apps that waste power and generate heat. Along with tools in our Symphony™ SDK and Adreno™ SDK, Snapdragon Profiler is a step on the path to heterogeneous programming and a valuable tool in building VR applications. It shows you how your code affects different cores and resources on the Snapdragon processor.

In this post I’ll show you three ways you can use Snapdragon Profiler to examine what’s happening inside your app. In my next post I’ll describe three worst practices of VR programming and show you how to profile them.

When your app is too hot

First, here’s an example, brought to you by mobile devices that get uncomfortably warm.

We’ve all read and seen what happens when a phone runs too hot. Temperature matters, whether it accumulates in the battery, the memory or the computing cores. That’s why Snapdragon Profiler shows you how your app affects temperature in the test device and how temperature affects compute power.

The screenshot below comes from Snapdragon Profiler running on my desktop while connected via USB to a very CPU-intensive app running on my test device.

The operating temperature of the CPU cores could stay at 150°F/65°C for only so long before frequency collapse, when the system scheduler and power monitors told the cores to run at a lower clock frequency so the device could cool off. You can see that CPU 0/1/2/3 Frequency and GPU % Utilization fell off like a rock for about one minute, then gradually inched back up.

If that happened in your VR app, how do you think it would affect user experience? Performance too would fall off like a rock. Your app would struggle to render frames as before, but at a lower clock frequency and a lower frame rate. The hardware wouldn’t be able to keep up. Your users would one-star you to death.

Three modes for profiling Snapdragon

That’s the kind of information Snapdragon Profiler gives you about your app. It offers three different modes for exploring app performance.

Real time – The screenshot above shows profiling in Snapdragon Profiler’s real-time mode, with my development machine connected to the test device via ADB over USB (or Wi-Fi). You can select running apps, services and widgets and see how they affect CPU, GPU, memory, network and thermal profile.

Trace capture – To display kernel and system performance over time, trace mode captures events at a high sample rate. In the screenshot below, Snapdragon Profiler shows DSP metrics and driver activity as surfaces are rendered in a VR app.

Snapshot – Analyze textures at the frame and buffer level in snapshot mode. You can see how your scene is being constructed with OpenGL ES: draw calls, object attributes, shader code and pixel history. In the partial snapshot below I’ve indicated the draw calls for right eye and left eye in a VR app.

Snapdragon Profiler works with all devices powered by Snapdragon processors. That includes commercial and development boards such as the DragonBoard 410c. (Expect limited functionality on non-Snapdragon devices.) The more recent the device and version of Android, the more valuable the information you can get from Snapdragon Profiler.

Nothing in these materials is an offer to sell any of the components or devices referenced herein. References to "Qualcomm"; may mean Qualcomm Incorporated, or subsidiaries or business units within the Qualcomm corporate structure, as applicable. Materials that are as of a specific date, including but not limited to press releases, presentations, blog posts and webcasts, may have been superseded by subsequent events or disclosures. Qualcomm Incorporated includes Qualcomm's licensing business, QTL, and the vast majority of its patent portfolio. Qualcomm Technologies, Inc., a wholly-owned subsidiary of Qualcomm Incorporated, operates, along with its subsidiaries, substantially all of Qualcomm's engineering, research and development functions, and substantially all of its products and services businesses. Qualcomm products referenced on this page are products of Qualcomm Technologies, Inc. and/or its subsidiaries.