Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Xbox One Profiling Analysis - 15MS Spike

Discussion in 'Windows' started by snair692, Feb 7, 2019.

  1. snair692

    snair692

    Joined:
    Feb 2, 2016
    Posts:
    36
    So trying to get my game to run smoothly on the XBOX one (I have been developing it for around 14 months at this point, xbox one has been a major struggle).

    I need to gain about 7-8 FPS reliably, and I need to reduce the 10-15 ms spikes that happened intermittently. If I can accomplish these two goals or close to it, I will have a smooth running game.

    Right now I am focusing on the spikes, and I have made great strides at reducing issues. One of the major issues I had was with the Physics processing time which is taking considerably longer on the XBOX one, I am having to make tough decisions about what objects have colliders, what types of colliders they are etc. That was a major break through.

    But here is the problem: I have come across this very bizzare spike that I can't seem to pinpoint or resolve, I can't even find any information about what it is or what is causing it. Attached is the profiler view while the game is running on the xbox one.

    What is this "EarlyUpdate.PlayerCleanupCachedData" -- it is spiking almost to 15ms with considerable consistency. That's not good! 15ms is way way way too much on any given frame and it's causing the xbox to drop from ~30fps to 15fps when it happens.

    Any thought or input on this one would be helpful as I am at a loss for what this is or what it is doing.

     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,590
    Can you expand it all the way down in the profiler, so we see what specifically is taking 15ms?
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Indeed, can you tell us what's under that PlayerCleanupCachedData? I am looking at source code but it could be several things.
     
  4. snair692

    snair692

    Joined:
    Feb 2, 2016
    Posts:
    36
    Well I can assure you that when I drilled down on that final element there was nothing enlightening inside of it but to give you guys an update the situation has resolved itself. I have been building and testing, building and testing, building and testing, building and testing for the past 40 or so hours and I've got it now running at a "smooth" 30 FPS.

    I think there were some issues I was running into that are xbox one platform specific and having to do with GPU Skinning and GPU Instancing one of which is an experimental feature.

    Seems as if when those are both checked on the windows platform build in quality settings FPS goes up nicely.

    I did lots of other 'improving' too mostly for minimal gains, the #1 thing that seemed to have the largest impact was removing the "Scrolling Combat Text" which was an asset store addon I was using for world-space combat text. Works perfectly fine on the desktop, great even, but on the xbox it just doesn't perform well at all when using the world space option. It could also be the amount of dynamic text being generated I really wouldn't know unless I write my own solution which I might need to just to see.

    Otherwise I am okay with having to sacrifice the world-space combat text for smooth FPS on the xbox. I am pretty confident that it was the Scrolling Combat Text Addon for world space dynamic text that was messing me up all along.
     
  5. snair692

    snair692

    Joined:
    Feb 2, 2016
    Posts:
    36
    I say "smooth" in quotations. It's as smooth as one can expect on an older Xbox one and probably as smooth as I am going to be able to get it.

    Is there any performance gain achieved by targeting the "Xbox one platform" itself instead of the "UWP" platform? I know I got to get into the Xbox @Id which i plan to but I'm not sure if I should expect that to improve performance or not. My understanding is currently it's about the same performance wise, is it not?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    You get an extra CPU core, and a little lower overhead if you've using D3D11. It shouldn't make any difference if you're using D3D12.
     
  7. snair692

    snair692

    Joined:
    Feb 2, 2016
    Posts:
    36
    Well I do have D3D12 (experimental) enabled as a target, but I can't seem to remove D3D11, i suppose this was a normal/intended thing, but how can I be sure it is using the D3D12 and not the D3D11?
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    It should say which one you're using in the player log. You can also check this property: https://docs.unity3d.com/ScriptReference/Rendering.GraphicsDeviceType.html

    It is intended that you're not able to remove D3D11, as it's the fallback option in case drivers for D3D12 are not available on the device. However, Unity will always try first API in the list, and if that fails it tries second one, etc.

    Which Unity version are you on?
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Also, could we please get a bug report on that PlayerCleanupCachedData. I'm pretty sure it's a bug on our side.
     
    Peter77 likes this.