Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

When I run the Store Test Kit's profiler against my game, I get a warning that says something along the likes of "Very high CPU usage on the UI thread for operations other than frame drawing."

According to the library I am using, I am still getting around 59-61 fps when I test it on a WP8, WP7.8, and a first gen WP7.5 device.

Should I be concerned? If I were to use Tasks or Parallel, does it throw it off to another thread? Or is this simply just a matter of optimizing my code.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

It's something you should look into. There's an article on MSDN about this warning. Essentitally, it's a matter of optimizing you code, but it's important to profile the code so you know what to optimize. These are the steps listed in the article:

To investigate high CPU usage on the UI thread

  1. To investigate a high CPU usage warning, click the arrow next to Performance Warnings and then click Frames and then Functions in the menu. The Functions view will be displayed. The Functions view shows every method that was called during the selected part of the timeline. These can be methods in platform code or app code.

  2. Click the Inclusive Samples column header until the functions are sorted by these values in descending order (highest to lowest).

  3. Look for methods that are part of your app code on the top of the list. One or more the apps methods will likely be up at the top of the highly-sampled functions. This could, meaning you may be calling the method very often, or the method might be inefficient or take a long time to successfully execute. Either way, it is causing a UI block that is leading to a problem with the app’s responsiveness.

  4. Optimize the code for that method or move it to non-UI thread.

share|improve this answer
    
Thank you. I must have read that a thousand times, but some how skipped #2, and just focused on #4b. I think the "non-UI thread" part has sent me down a wrong path. –  Schandlich Feb 22 '13 at 21:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.