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

Bug Unity 2022.3.2 and above - massive performance regression in editor

Discussion in 'Editor & General Support' started by MikeSz, Sep 30, 2023.

  1. MikeSz

    MikeSz

    Joined:
    Jul 7, 2014
    Posts:
    28
    Hello,

    This issue has been ongoing for us for months and no version update changed anything. 2022.3.1 is the last version that is usable for us - but since we don't do ANYTHING weird and this happens is empty projects as well... time to post. This issue needs fixing as it prevents laptop users from working at all (battery and heat)

    TL: DR - Newest versions of last LTS have a significant and persisting CPU usage in idle, with memory being constantly allocated. This is caused by "OpenProject.exe" process

    As they say - picture is worth a thousand words. This is our project in editor mode, not play mode. Just idling. Yes - this is idling on 12 core / 24 thread CPU. And be aware - 9% is not "9%" - it's full 100% of one core

    There's also a crap ton of processes being run, no idea why the are not being closed. In some test runs I was above 50 processes, with 15 console windows host etc, 15 shader compilers etc This behavior is visible in 2022.3.1f1 as well but it doesnt produce any negative fallout

    The same project opened in 2022.3.1 (last one that works for us) uses 0.0% in idle, but in 2022.3.10?

    upload_2023-9-30_12-20-2.png


    This is also extremely visible in empty projects after adding some plugins. Basically create a new project, copy some plugins (DoTween, i2, SteamWorks, TMP... nothing out of ordinary, not our packages or our code) and observe:
    - 0.0% CPU consumption in 2022.3.1
    - 3-9% overall CPU consumption (again - this is a big pressure on a single CPU core) in any later LTS
    - overall we see icnreased CPU usage per plugin added - this is only in 2022.3.2 and above

    This is happening to all members of our team so it's not related to a specific machine or hardware configuration

    Here is a screenshot from a test project - 2022.3.1 (top) vs 2022.3.10 (bottom). Plugins imported: DoTween, ParticleEffectForUGUI, Sirenix Odin, TextMeshPro, just standard things. Adding any additional plugin will just make it worse. Memory usage also being constantly increased. This is in editor mode, in console view, completely empty scene

    Again - I understand that it looks like "oh, just 0.5% CPU usage, why u b*tching*. Well, frist of all - this is something that didn't happen before. Second - this idle CPU usage increases with every single new plugin or piece of code added. This is not viable for active projects and it prevents CPU from going into any low power mode, destroying battery life for laptop users

    upload_2023-9-30_12-48-21.png

    This actually seems to look a lot better than what we saw with 2022.3.8 but it's still clearly an issue. Here is a pic of what we saw in 2022.3.8 (I posted this in local gamedev forum)

    upload_2023-9-30_13-0-31.png

    And the CPU graph was also completely bonkers. Yes, just 2022.3.8 with empty project
    upload_2023-9-30_13-1-37.png
     

    Attached Files:

  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,355
    You can look at Task Manager all day long, the only thing that really helps to analyze is the Profiler.

    Put it in editor mode, enable deep profiling, and check where most of the time is spent. You may want to compare that with previous editor versions and submit a bug report.

    There's been a couple reports that 2022.3 has some "EditorLoop" spikes.
     
  3. MikeSz

    MikeSz

    Joined:
    Jul 7, 2014
    Posts:
    28
    You are 100% right, I omitted this detail! However... Nothing shows in profiler. Just the profiler.repaing and other typical Untiy ticks. Profiling editor in 2022.3.10 also works a bit different, unless I move my mouse the typical .Idle is not 3 ms any more but 100 ms. Not sure why, not that it changes anything

    So... I really don't know. It's not showing up in profiler in any way. Yet I can clearly see just having the editor open in background hitting my CPU

    Oh, wait... I might be up to something. Profiling in 2022.3.7 (checking this one as well) shows completely uncounted and unrepresented in main view ~240 KB of memory garbage generated per frame. Which then stops for a few seconds and shows up again. This does NOT happen in 2022.3.1

    2022.3.10 also shows GC spikes that don't correspond with anything else visible in Profiler, but with a different pattern of spikes and not continous one

    upload_2023-10-1_10-47-28.png

    I really don't know what to think here

    Again - editor in background, doing nothing. Increased CPU consumption preventing laptop users from gettign any battery life and unexplainable and increasing memory pressure

    ---

    Once more - 2022.3.1 (top) vs 2022.3.10. Mostly empty project that I use to time tweens and particels. DoTween, TMP, Odin and ParticeEffectForUGUI are only things added. No scripts of my own

    This is after running a few seconds of editor profiling, outside of playmode, outside of scene or prefab mode

    upload_2023-10-1_10-51-10.png

    And this is what it does to CPU usage. Hell for laptop users...

    upload_2023-10-1_10-52-26.png
     

    Attached Files:

  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,355
    Note that when you profile different editor versions you have to be sure the setup is entirely the same as much as possible to be able to reliably compare the observations. This includes the open scene, what you have selected in the scene and project hierarchy, and what editor windows are open. The Inspector showing something different in both runs can have a rather large impact on the results.
     
  5. MikeSz

    MikeSz

    Joined:
    Jul 7, 2014
    Posts:
    28
    Yes, obviously. And I noted multiple times that it is exactly the same setup. Project copied from one location to another (sans Library), opened once to import all assets, then closed and freshly reopend. So identical scenarios
     
  6. MikeSz

    MikeSz

    Joined:
    Jul 7, 2014
    Posts:
    28
    Bump I guess?
     
  7. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,256
    Could you please use the Editor menu
    Help > Report a Bug
    with such a project so that we can take a look at this?

    Also, I sort of doubt that this is related but there have been a couple of memory leaks that were fixed on 2022.3.10f1 but there's also a job system work-stealing race condition bug that was introduced by a backports in 2022.3.3f1 and fixed on 2022.3.14f1.

    If you for to your preferences what's the Editor interaction Mode set to?

    Took me a moment to understand what you meant by "uncounted in main view". The Memory Usage module shows the per frame managed allocations across all threads. The CPu Usage module's Hierarchy view only shows you one thread at a time, by default the main thread. Allocarions can happen on any thread though and might be coming from a background thread. You can flip through the threads with the drop-down next to the "Live" toggle, or switch from Hierarchy to Timeline to spot which thread has GC.Allocs. In Timeline view they are colored bright magenta and if you find one, select it and switch back to Hierarchy, the selection will carry over and flip Hierarchy view to the appropriate thread.

    Also note that you may want to click the three dot menu to the far right of the "Live" button and toggle off Collapsing of Editor Only samples, as that may hide some normally unimportant allocations from view to avoid unnecessary distractions when optimizing.

    You may also want to turn on Allocation Callstacks (so that you don't need Deep Profiling in cases where that may cause too much overhead, and get a bit more info than that can give you too) to see where those allocations are coming from. That info would help greatly in determining where this regression came from.
     
  8. MikeSz

    MikeSz

    Joined:
    Jul 7, 2014
    Posts:
    28
    Thanks for reply. I checked a small test project and things looked somewhat fine... until I pressed play and then stopped

    First editor (with 28 processes) - 2022.3.13f1 opened and entered playmode, that's all. Second (9 processes) is 2022.3.1f1 that I opened... days ago and worked on for a few days with multiple playmode runs, script additions, removals etc etc

    upload_2023-11-13_11-2-6.png

    Once again upon unrolling it's filled with multiple copies of window hosts, shader compilers etc

    However... Next time I opened the test project evertything looked good, performance RAM usage, everything. I even checked how per core frequencies in Ryzen Master and parking them to sleep - found no issues this time

    Full project... First run + playmode once again led to massive duplication on shader compilers and window hosts. Unfortunately in this case subsequent runs dont look good nd one of the cpu cores keeps being pushed even when Unity is completely idle, empty scene opened, scene view closed and editor in background

    Overall - things are definitely better but not there yet. Also - I'm starting to doubt if those 2 issues are connected. Clearly the one with processes and RAM not being cleaned properly is easier to replicate, but the CPU one is harder to pinpoint

    Unfortunately I cant send our full project... but will try to get all the possible plugins and libraries out of it and see again
     
    MartinTilo likes this.
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,027
    I have also noticed the idle CPU usage a lot, without any scene open in Unity, both in 2021.3 and 2022.3 and with minimized Unity

    One would expect zero usage if not in focus
     
  10. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,256
    Have you tested if version 2022.3.14f1 improved things?