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 extremely slow (Application.idle taking 98%)

Discussion in 'Editor & General Support' started by EendhoornGamesFabraz, Jun 5, 2023.

  1. EendhoornGamesFabraz

    EendhoornGamesFabraz

    Joined:
    Jul 25, 2021
    Posts:
    2
    I came back to unity after a bit of an hiatus, and I'm not sure what happened but the editor became sooooo slow. I'm on a fairly fast laptop with a 3050 TI so I know that's not the problem.

    I've tried the profiler and it seems like the editor is taking a whopping 97.7%, all in EditorLoop -> Application.idle.
    upload_2023-6-5_20-17-3.png

    I tried on the 2023.0b13 version and also on 2022.2.21f1 and they behave identically.

    I've did some googling and set my Interaction Mode to monitor refresh, but it didn't make a difference.

    Here are the logs for the profiler;
    https://drive.google.com/file/d/1J4zuLLQPMkO_31Q5urQ9TMcg2jfbz91R/view?usp=sharing
    I hope the problem is just a silly setting somewhere!
     
    Last edited: Jun 5, 2023
  2. decaf

    decaf

    Joined:
    Feb 28, 2014
    Posts:
    3
    I'm seeing pretty much the same issue. Did you happen to find a solution?
     
  3. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,026
    Same on a modern Mac with latest LTS version. Battery life getting destroyed. Was previously using 2022.2.13 without these problems. Something changed between it and the later releases that's turned the thing into a CPU/GPU tax.

    Have turned off all MSAA and set vSyncs and frame rates to the right clamps... just as they were in the slightly older 2022.2.13b, but nothing seems to calm it down.
     
  4. decaf

    decaf

    Joined:
    Feb 28, 2014
    Posts:
    3
    I found a quick fix for my issue. Try disabling Preferences > 2D > Aseprite Importer > Background import.
     
  5. EendhoornGamesFabraz

    EendhoornGamesFabraz

    Joined:
    Jul 25, 2021
    Posts:
    2
    I'm glad you found something that works for you! Unfortunately it doesn't seem to make a difference for me, but I'm sure it's exactly something silly like this.

    Edit: Looking at the profiler, the Application.idle has gone down to 75%, so there's an improvement. There's likely another background process that's still slowing my editor down.
     
    Last edited: Jun 15, 2023
  6. decaf

    decaf

    Joined:
    Feb 28, 2014
    Posts:
    3
    I'm glad it helped a bit. I took a look at your logs and noticed OnGui calls seemed to be causing long frame durations. I have another lag spike occurring every minute or so that also happens during an OnGui call, specifically as a result of garbage collection.

    I'm pretty new to this stuff so I did a bit of research (Unity - Manual: Immediate Mode GUI (IMGUI) (unity3d.com)). I know I'm not calling OnGui, but it turns out a package I'm using - CorgiEngine - has a number of scripts dependent on OnGui.

    It might be worth doing a search through all your scripts for OnGui and see if there are any expensive operations running. I'll be revisiting the garbage collection spike on my end at some point and I'll drop my findings here if there's anything noteworthy.

    Apologies if all of this is obvious - like I said, still pretty new to this.