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. Dismiss Notice

Bug Editor Performance Drops Massively with Animators Enabled. (2020.3.43f1 LTS and 2021.3.16f1 LTS)

Discussion in 'Editor & General Support' started by xuwilliam01, Jan 7, 2023.

  1. xuwilliam01

    xuwilliam01

    Joined:
    Jun 17, 2018
    Posts:
    4
    Hey everyone, this issue has plagued our 2D project across both the 2020.3.41f1-43f1 LTS and 2021.4.13f1-16f1 LTS versions of the Unity Editor. (This has been observed on workstations equipped with i9 13900Ks and 7950x's, on both integrated GPU's and RTX 4090 with 64GBs of ram)

    The issue manifests itself when animators are active in the scene, and affects both the editor's Game and Scene windows.

    Tweaking settings and upgrading editors (and included packages didn't seem to help)

    I have profiled the editor and play mode, and determined that when animators are active, the EditorLoop consistently throws ~55ms delays that causes the FPS in game to tank. The culprit here is EditorApplication.hierarchyChanged: UnityEditor.U2D.IK.IKEditorManager.Initialize.

    I have looked into it online to no avail. Unity Collections and Burst packages do not seem to remedy the issue either.

    Comparison of EditorLoop Interrupts in Scene With Animators Active vs. Disabled:
    https://i.imgur.com/udTUlDT.png

    Comparison of EditorLoop Interrupts in Game View vs Scene:
    https://i.imgur.com/qObaJen.png

    GPU Spikes Overlayed With CPU Spikes:
    https://i.imgur.com/SK2A4TJ.png

    Unit Stats Window FPS vs In Game Reported FPS:
    https://i.imgur.com/3OgRIj6.png


    Hopefully there is a solution/patch to this issue, it's been quite a big headache for us trying to preview animations in our project during runtime.

    Cheers!
     
  2. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    875
    xuwilliam01 likes this.
  3. xuwilliam01

    xuwilliam01

    Joined:
    Jun 17, 2018
    Posts:
    4
    Awesome, thanks for your response!

    Hopefully this inadvertently reduces some headaches for other people who've been plagued by the same issues.
     
    Ted_Wikman likes this.
  4. xuwilliam01

    xuwilliam01

    Joined:
    Jun 17, 2018
    Posts:
    4
    Hi @Ted_Wikman , just checking in again.

    I've profiled the project again on 2020.3.44f1 and have observed the same spikes, albeit just as an invocation of EDITORAPPLICATION.HIERARCHYCHANGED .


    With animations in the Game Window:

    Unity Version Confirmation: https://i.imgur.com/nSjgdYE.png
    Profiler attached to Playmode, note the editor interrupts: https://i.imgur.com/ltAN828.png
    Profiler attached to Editor, EDITORAPPLICATION.HIERARCHYCHANGED spiking consistently to 100ms corresponding with the frame drops :https://i.imgur.com/FfIlNJH.png

    No Animations in Game Window,
    Profiling Editor: https://i.imgur.com/qrNdzzd.png
    Profiling Playmode: https://i.imgur.com/9LVCFFM.png

    The system in question has a i9 12900k, other background processes are idle when capturing the data.

    Hope this helps!
     
    Ted_Wikman likes this.
  5. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    875
    Thank you for testing it out, I'll notify the QAs handling the case of your discoveries.
     
    xuwilliam01 likes this.