Getting the maximum Performance out of your Game or App on Windows 8 and Windows Phone


Performance tools and resources to help you get the best customer experience.

Unity Profiler for Windows Phone & Windows 8

Windows Store Apps: Profiler

You can connect Unity3d profiler to running Windows Store Application. Perform the following steps:

  • Build Windows Store App Visual Studio solution from Unity.
  • After opening the solution, open Package.appxmanifest->Capabilities
  • Enable Internet (Client & Server)
  • Enable Private Networks (Client & Sever)
  • Build and run the application
  • If you’ve checked Autoconnect Profiler checkbox, the profiler should connect automatically to Windows Store App, if not – you have to explicitly pick it in Unity (Window->Profiler->ActiverProfiler), for ex., MetroPlayerX86 (MyDevice)

Note: Profiler doesn’t work on Master configuration

Note: Due Windows Store Apps restrictions, you won’t be able to connect the profiler if the application is running on the same machine. For ex., if you’re running Unity editor and Windows Store App on the same PC, you won’t able to connect. You have to run Unity editor on one machine, and Windows Store App on another machine.

Note: Also ensure that machine where Unity3D Editor is running and machine where Windows Store App is running – are on the same subnet.

See http://docs.unity3d.com/Manual/windowsstore-debugging.html

Windows Phone 8: Profiler

One of the simplest ways to profile Windows Phone 8 app is over WiFi. Build your app with Development Build enabled in Build Settings (or choose Debug or Release configuration if you’re building from Visual Studio). Deploy and run the app. Open Profiler window in Unity and select WP8Player from Active Profiler menu. Incoming data will appear on the screen. Please keep in mind that GPU profiling is not yet support on Windows Phone 8 platform.

Troubleshooting

If WP8Player option doesn’t appear in Active Profiler menu you can try connecting directly to the phone by manually specifying IP address. Also make sure that Unity Editor is not blocked by the firewall. Profiler might also not work if connected to the public network.

See http://docs.unity3d.com/Manual/wp8-debugging.html

Visual Studio Graphics Diagnostics – http://msdn.microsoft.com/en-us/library/hh873207.aspx

The Graphics Diagnostics tools in Visual Studio are designed to help you locate rendering problems by starting with the visual artifacts that indicate the problem and then tracing back to the source of the problem by focusing only on relevant shader code, pipeline stages, draw calls, resources, and device state in the app’s own source code.

Here are some of the kinds of rendering problems that Visual Studio can help you solve.

Device state

Correct configuration of the graphics device is important because it determines how the graphics pipeline interprets the data associated with each draw call, and how draw call outputs are merged. For example, if the device state specifies the clockwise vertex winding order, then any model that specifies vertices in a counter-clockwise order will not be rendered correctly. Device state problems can be difficult to diagnose because the root of the problem in the source code is often far removed from the affected objects. By using Graphics Diagnostics, you can view the current device state at any time during rendering.

Uninitialized or incorrect constant buffers and parameters

Graphics apps use constant buffers and parameters to pass additional data to a draw call or set of draw calls. For example, the data might specify different locations or appearances for different objects. When that data is not initialized or contains incorrect values, the corresponding object is rendered incorrectly, or perhaps not at all. This kind of problem can be difficult to diagnose because it’s not always clear whether the problem is in the data or the shader code that consumes it. It can also be difficult to determine which shaders, constant buffers, and parameters correspond to the error. You can use Graphics Diagnostics to determine which shaders, constant buffers, and parameters apply to each draw call, and view their contents.

Shader bugs

Making a mistake in app code is almost inevitable, whether the code is C++ or High Level Shader Language (HLSL). However, debugging HLSL code has traditionally been more difficult because it hasn’t had the rich debugging support that C++ and other languages enjoy. Graphics Diagnostics brings traditional code debugging tools to HLSL so that you can step through code, set breakpoints, and examine the contents of variables, parameters, and constant buffers.

Windows Phone Developer Power Tools – http://msdn.microsoft.com/en-us/library/windows/apps/dn629255.aspx

Windows Phone Developer Power Tools are three powerful testing and debugging tools for app developers packaged into a single user interface. Use the Power Tools to monitor your app’s responsiveness and resource consumption and to debug its crashes. After you make fixes, run the tools again to verify the improved stability and performance of your app.

The Power Tools include the three following tools. These are existing tools that have been adapted and customized for use by Window Phone developers.

  • Application Verifier. Detect subtle programming errors in native code.

  • Performance Monitor. Capture real-time performance metrics and visualize them graphically.

  • Performance Recorder. Collect system-wide logs and analyze them on your computer.

Windows Performance Recorder – http://msdn.microsoft.com/en-us/library/windows/hardware/hh448205.aspx

Included in the Windows® Assessment and Deployment Kit (Windows ADK), Windows® Performance Recorder (WPR) is a performance recording tool that is based on Event Tracing for Windows (ETW). It records system events that you can then analyze by using Windows® Performance Analyzer (WPA).

Windows® Performance Recorder (WPR) is a tool that extends Event Tracing for Windows (ETW) and provides detailed recordings of system and application behavior and resource usage. You can use WPR together with Windows Performance Analyzer (WPA) to investigate particular areas of performance and to gain an overall understanding of resource consumption. WPR and WPA enable development and IT professionals to proactively identify and resolve performance issues.

You can download WPR by visiting http://go.microsoft.com/fwlink/?LinkID=293840.

Windows Performance Toolkit – http://msdn.microsoft.com/en-us/library/windows/apps/dn391696.aspx

Included in the Windows Assessment and Deployment Kit (Windows ADK) and the Windows software development kit (SDK), the Windows Performance Toolkit consists of performance monitoring tools that produce in-depth performance profiles of Windows operating systems and apps.

To learn more about how to use the Windows Performance Toolkit to help you improve the performance of your Windows Store app using C++, C#, or Visual Basic, see the Windows Performance Toolkit Technical Reference. This technical reference discusses both the Windows Performance Recorder (WPR) and the Windows Performance Analyzer (WPA).

Additional Resources

How to Analyze Performance Issues in Your Windows and Windows Phone Apps https://channel9.msdn.com/Events/Build/2014/4-557

Comments (2)

  1. Dev says:

    How to do the same with MonoGame or XNA? Also what is Unity? Is this same as the Unity3d engine or is it the IoC container?

  2. Lee Stott says:

    Dev

    Hi yes Unity3d http://www.unity3d.com the gaming engine if your using XNA this is natively supported on all Windows Phones.. Also if your in the UK I would suggest you attend this MonoGame XNA session  you need to attend this #monogame cross platform 14th October @SoftSavage & @infspacestudios http://www.meetup.com/…/208094272