Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Performance issues when using URP

Discussion in 'Universal Render Pipeline' started by roflnoob, Feb 3, 2023.

  1. roflnoob

    roflnoob

    Joined:
    Mar 3, 2015
    Posts:
    3
    Hi all,

    I have been having random spikes in performance using the URP. According to the forums, this is caused by the rendering taking too long, causing the spike in Physics.Processing, but even when I delete all the scene objects this spike in Physics.Processing keeps popping up. Not sure what I am missing. I am not using deep profile in these images but even in deep profile I don't see what could be causing this.

    Using Unity 2021.3.15f1 on Win10 with IL2CPP

    Anybody knows what might be causing these spikes and what I can do to fix this issue?

    Thanks!

    hierarchy.png
    profiler_overview.png
    stats.png
    timeline.png
     
  2. alexander_degtyarev

    alexander_degtyarev

    Unity Technologies

    Joined:
    Dec 8, 2020
    Posts:
    3
    Well, it's not clear from the capture what's happening here, but I'd assume that it's unlikely that it's a URP issue. Can you record a trace with the physics module and if possible upload the trace file, or just post screens that will include all job worker threads and Physics module trace? If you can repro this with deep profiling enabled or even record trace using a native profiler like superluminal/vtune it can supply even more details to find the reason for the spike.
     
  3. roflnoob

    roflnoob

    Joined:
    Mar 3, 2015
    Posts:
    3
    Hi Alexander,

    Thanks for the fast reply.

    I did some more profiling and also tried to use VTune, but don't know how to export my results from there.

    Here is a screenshot of the deep profiler hierarchy:
    deep_profile_hierarchy.png

    The same snapshot but from timeline view:
    deep_profile_timeline.png

    I also took a capture of the physics module, here is one with my scene objects active:
    physics_module.png

    And one with all objects in my scene deleted:
    physics_module_nothing.png


    Also here is a screenshot from VTune, but I dont really know if this is what you are looking for:
    vtune.png
     
  4. alexander_degtyarev

    alexander_degtyarev

    Unity Technologies

    Joined:
    Dec 8, 2020
    Posts:
    3
    Well It didn't become much clearer, seems like all the time spent inside physics.processing marker which shouldn't take that much when you have only 1 static collider active. What actually happens at this moment?
    Vtune capture doesn't show the specific frame, but rather a range of frames, you can, however, try to dig deeper into the callstack related to physics processing to understand what function call is taking most of the time.
     
  5. roflnoob

    roflnoob

    Joined:
    Mar 3, 2015
    Posts:
    3
    It happens seemingly randomly, the game would literally be doing nothing and these spikes would show up. I have been working on a different project recently than the screenshots above, and started noticing the spikes in that project too. Again, these spikes occur while standing still, moving my player character (the rigidbody) or just turning the rigidbody. I tried upgrading unity to 2022.1.23f1, and in this version, the spikes are even worse and more frequent, see attached images. Found this thread with similar problems, apparently these issues started after Unity version 2018:
    https://forum.unity.com/threads/uni...proccesing-rendering-spikes-and-more.1056236/
    new1.png
    new2.png
    new3.png