Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Extremely slow editor in 2019.2.0a7

Discussion in '2019.2 Beta' started by DefiantDev_Chris, Mar 7, 2019.

  1. amesa_unity

    amesa_unity

    Joined:
    Oct 16, 2019
    Posts:
    5
    Somebody is getting really bad editor performance in 2019.3.0f6? I have to wait each time i click or scroll in the main player game object. The game object has a lot of components but in 2019.2 the performance wasn't so bad as it is now.
     

    Attached Files:

  2. GainfulSage

    GainfulSage

    Joined:
    Apr 30, 2015
    Posts:
    106
    Found this issue via Google. Turned out my issue was (accidentally) generating excessive Debug.Log entries, which was manifesting as poor performance. Not saying this is the issue for anyone else, just noting it as a possible fix for future Google searches for Semaphore.WaitForSignal.
     
    peanutt likes this.
  3. JosephGovi_TechArtist

    JosephGovi_TechArtist

    Joined:
    Oct 3, 2018
    Posts:
    4
    Random fix that worked for me, was to reset the Unity Editor Layout by choosing one of the default layouts
     
  4. whalepaha

    whalepaha

    Joined:
    May 8, 2018
    Posts:
    2
    20200219180120.png
    We updated our project to Unity2019.2.19f1 and now have very strange issue. In any part of the game when interned connection turns off our connection service tries to reconnect to the server.

    And we start to receive this 1 second spikes.
    Call stack shows that Semaphore waits in Canvas.BuildBatch() function.

    This happens only on IOS devices.

    How reconnection can cause that strange spikes? Limited thread pool or something?
    We cannot release with this issue.
     
  5. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    2019.2 isn't supported, since the release of 2019.3.
    The fix didn't land in 2019.2 before it became unsupported, and as such, it will never be fixed in that version, because there will be no more patches for 2019.2.

    If you need a version that has long term support that includes bugfixes (2 years guaranteed) you should be using an LTS build. The options are 2017.4, 2018.4, or 2019.3 (because it is the last release of the year, it will magically become 2019.4 once we are happy with quality).

    https://unity3d.com/unity/qa/lts-releases
     
    Last edited: Feb 19, 2020
  6. RepoGames

    RepoGames

    Joined:
    Apr 15, 2016
    Posts:
    69
    Yeah, latest version very slow for me also
     
    amesa_unity likes this.
  7. whalepaha

    whalepaha

    Joined:
    May 8, 2018
    Posts:
    2
    Thank you for reply, for various reasons we cannot update to Unity 2019.3 at this time.

    We found that one of the our services mistakenly sent UnityWebRequests each frame (so 30 times per second) after missing answer from server.
    Lags are gone after we added some period to this requests.

    Another team in our organization had similar issue, they fixed it by replacing UnityWebRequest by common .Net realization.
     
    richardkettlewell likes this.
  8. Batuhan13

    Batuhan13

    Joined:
    Apr 9, 2017
    Posts:
    117
    Hi friends yesterday I had same issue ("Semaphore was using %90-%80 of my cpu) on my version ("2019.3.1f1"), my android build was lagging extremly in empty scene so Today I solved that issue with upgrading to 2019.3.3f1 =) .I hope it will solve your problem too .Have a good day
     
  9. Batuhan13

    Batuhan13

    Joined:
    Apr 9, 2017
    Posts:
    117
    Nope it is still lagging extremly becase of semaphore =(
     
  10. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    57
    Unity Team, is the problem really semaphore, or is there another correlated issue? I'm new to using profiler, but was drawn immediately to semaphore, as it was a top % user in the profiler. If it's a red herring, let us know where else to look please. Or provide a complete write-up of what semaphore does and how to interpret it's activities in profiler.
     
    Batuhan13 likes this.
  11. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    This is the best answer I have right now: https://forum.unity.com/threads/extremely-slow-editor-in-2019-2-0a7.640354/page-3#post-5392530
     
    MartinTilo likes this.
  12. WildMaN

    WildMaN

    Joined:
    Jan 24, 2013
    Posts:
    128
    Updated to 2019.3.7f1 and got 12ms wasted every frame on Semaphore for no good reason.
    Solution: roll back to 2019.3.6
     
    fherbst likes this.
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    I tested from 2019.3.4 to 2019.3.7 and it happens only when I activate the Oculus headset.
    2019.2.15f1 is still working.

    This is what it looks like in 2019.3.7f1 editor: Semaphore Bug.jpg
     
    Last edited: Apr 3, 2020
    dchen05 and ROBYER1 like this.
  14. Batuhan13

    Batuhan13

    Joined:
    Apr 9, 2017
    Posts:
    117
    Sorry I dont get it, is 2019.2.15f1 working fine or it is have a semaphore bug like new other versions?
     
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    I meant I'm not seeing the semaphore bug in 2019.2.15f1.
     
    Batuhan13 likes this.
  16. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    For me this is the cause for huge slowdowns in Editor on Domain Reload since we are evaluating some assets and running tests in InitializeOnLoad, which worked fine in the past.

    It seems that in recent version (2019.3.0f6 was fine, 2019.3.5 - 12 have that issue) there have been underlying changes in AssetDBv2 that result in giant amounts of file reads when calling things such as AssetDatabase.GetMainAssetTypeAtPath(). This call seems to now load in the full file (which it explicitly is supposed to not do), which obiviously takes forever for large files (e.g. 400 MB Texture Arrays).

    In our project, this has bumped Domain Reload times from 2-10s to >100s, with 50-80 seconds being spent on checking the type of assets (in one of our scripts that was working fine in earlier versions):

    upload_2020-4-30_17-0-48.png

    Another call that now misbehaves is "AssetDatabase.GetDependencies" which used to be very fast but now takes forever as well since it fully reads all files in:
    upload_2020-4-30_17-2-6.png

    (note that this is 5 (!) calls to GetDependencies resulting in 1.5 million File.Read calls.)

    I was able to reproduce the second issue in (Case 1242985) [AssetDBv2] AssetDatabase.GetDependencies does a full file read of dependant files. I added some notes about the first one as well but wasn't able to replicate it in this simpler project (I couldn't trigger that Semaphore wait).
     
  17. Alex_qiang

    Alex_qiang

    Joined:
    Jun 8, 2019
    Posts:
    11
    There is a very serious bug.
    [My version] Unity 2019.3.13f1, 2019. 2019.2.15f1,2019.3.7f1
    [My Device] Iphone 11 Pro Max
    [Desc] Random FPS drop,I sure my code and gpu is have no issue.
    When FPS drop under 50, I will set all gameObject.setActive(false). But the profiler will tell me “PrepareRenderTarget” has took up a lot of time, and the FPS will restore 60 after many frames.
    I can see the GPU time in xCode, only 3ms.

     
    Last edited: Jun 7, 2020
  18. DanielRiches

    DanielRiches

    Joined:
    Nov 23, 2019
    Posts:
    165
    I think I have some insight into this Semaphore issue:

    Yesterday I was having the Semaphore thing in the profiler, I believe i've nailed down the issue, I had a few thousand cubes in my scene and removed all the realtime shadows from them and the problem was eliminated, however, even WITH those shadows activated it should have just crunched my FPS under some other profiler name (probably rendershadows or something), so I started thinking about what could have caused the semaphore and I believe it's because I have several points lights in my scene covering the entire scene from different directions, so technically nothing casts a shadow, but because the object has cast shadow on it's effectively "waiting" to be able to cast a valid shadow, and because that never happens, the thread is just constantly "waiting", thus creating the semaphore. Thats not to say it's the exact reason as it may have only been applicable to my situation, but hopefully this might give some insight as to the sorts of situations this happens in.
     
  19. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    Thats not likely the issue. the cast shadow flag just tells unity if it should render that mesh when rendering the shadow buffer etc.
    If cast shadows is turned off it doesnt render that object into the shadow buffer. If no objects have cast shadows turned on it likely either clears the buffer to a default value or skips the step. Its not going to put the code into a wait loop related to not finding objects with cast shadows turned on. :)
     
  20. DanielRiches

    DanielRiches

    Joined:
    Nov 23, 2019
    Posts:
    165

    Yeah it seems your right, thought I spotted the issue but i've had it since again lol
     
  21. lazybitkings

    lazybitkings

    Joined:
    Oct 30, 2019
    Posts:
    4
    You mentioned turning dynamic resolution off in you camera, settings and scripts. How do I do that for each of them?
     
  22. lazybitkings

    lazybitkings

    Joined:
    Oct 30, 2019
    Posts:
    4
    I have a solution!!!

    I also had this problem, but when I changed my Fixed Timestep from 0.5 to 0.01333, the lag was completely gona and never came back! You should have a try!
     
  23. n8dev_yt

    n8dev_yt

    Joined:
    Apr 14, 2020
    Posts:
    22
    This is so frustrating :((( nothing has worked, I have yet to try upgrading from 2019.4.0
     
  24. shohamblau

    shohamblau

    Joined:
    Feb 19, 2017
    Posts:
    2
    forcing unity to work in opengl mode fixed my issue.

    i migrated a project to unity 2019 and experianced really bad fps in editor, from 300+ fps to 25 and a choppy 25 at best.
    tried updating to newer unity 2019.4, nothing helped.
    even a simple project with a box and no lights was sluggish.

    except, changing from running unity in DX11 to opengl, gave me back all those wonderfull frames back and since my project is basically written in opengl this works for me.

    upload_2020-7-15_21-20-10.png
    upload_2020-7-15_21-20-22.png
    upload_2020-7-15_21-20-33.png
     
  25. shohamblau

    shohamblau

    Joined:
    Feb 19, 2017
    Posts:
    2

    ps. semaphore is still there, but no slow down
    upload_2020-7-15_21-23-34.png