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

Awful Editor Game Start Time

Discussion in '2020.2 Beta' started by castor76, Jun 26, 2020.

  1. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Is it me, or after moving from 2019 to 2020, start time for playing has increased dramatically?

    I know there is experimental play mode which I can disable domain reload and all that, but honestly, these options are rarely used, because most of the time you have changed either scene or script itself, or both. And having this option in the project setting is worst, because you have to have this window open to change the option so often.

    And I am sure, updating project from using 2017 to 2019 then 2020, it keeps getting slower to start playing. And I am not saying that the scene is a lot heavier to load than before. The reloading of "whatever" seems to take really longer than before. And everyone I am working with says the same thing.

    Is this something that will be improved over alpha, beta stages? or will it just get slower and slower?

    Or is it just me that feels this way? (am I crazy? going mad? )
     
    luispedrofonseca and mahdi_jeddi like this.
  2. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You still use same packages on 2020? DOTS and burst, HDRP etc do add a bit to the play in editor start times.
     
  3. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I do use dots and burst. But I used to use that on 2017 and 2019. But on 2020 it is noticeably slower.
     
  4. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    I once found game start time in editor go from like 5s up to 20s+ over the course of several days and hundreds of starts, editor restarts, system restarts etc it just kept getting worse. Nothing significant enough had changed to warrant such a difference. In my case (at least), there seems to be a connection between this problem and the Library folder. After deleting this folder and restarting Unity Editor (which will take a while the first time after due to reimporting everything etc.) it dropped from like 20s down to 3-4s. Make sure to close Unity Editor first. Also make a full backup of the project in question before doing this just in case - the only things I've noticed as "issues" after this are that the build target platform isn't always what it was before (just need to click "switch platform" back to previous one in build settings), and the previous Scene that was open doesn't open automatically again from the project link in Unity Hub (just need to click File->Open Scene then the next time it does). The first thing I do now when things get sluggish is delete this folder - works every time.
     
  5. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Interesting.. and I wonder why deleting Library folder to retrigger import helps.. is this really true?
     
  6. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Mine seems to mention sprite atlas packing when I hit run when the loading dialogue comes up, does it several times a day too. Backported to 2020.1 beta and it doesn't happen there.
     
  7. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    Wild guess.. is Project Settings->Editor->Sprite Packer->Mode set to Always ?
     
  8. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    That's probably a setting which is on by default in 2020.2 alpha but in 2020.1 beta it's actually not there! Makes sense why 2020.1 beta works fine and 2020.2 always does it at the start of play mode.
     
  9. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    My guess and guts tells me that it is this asset databse version 2 that is causing some significant reloading time... this is by looking at the start play dialogue popoup displaying what it is doing.. also that is one thing that is different than from say Unity 2017..
     
  10. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    It would be great if you could supply us with a reproducible that shows decreased (enter playmode) performance once updated to a newer version. In the meantime, I've forwarded the thread to the team.
     
  11. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Yeah, I can understand why you would like to get a repro report... But you normally ( and it was for me ) to notice and really feel like so after using it sometime after upgrading, and going back version to make it work again just takes too much time off my development plan. I just wish I had some backup, but then it isn't going to be a fair comparison again.

    I just feel like the game should not take like 13-14 seconds to enter playmode... I had way more complicated game running with 5.x 2017.x version of Unity and they don't take as long as the one I am developing right now. And I am running it with much much more faster computer than before.. 2017 era.
     
  12. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    It's not you. Time to enter playmode from a script change has increased quite a bit since 2019.3.

    This is probably the best thread covering the issue: https://forum.unity.com/threads/cas...ty-project-takes-significantly-longer.691996/

    Some people including myself got the old enter playmode from script change times back by switching back to asset database v1 (this was on an older version of the editor from around the times mentioned in that thread not the latest beta/alpha).

    I then had to go back to v2 anyway because the latest DOTs requires it.

    It sounds like Unity aren't going to do anything about it unfortunately. I skimmed the thread again to revive my memory. Someone opened an issue but it got closed because QA couldn't reproduce enough of a slowdown or something.
     
  13. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Yeah, like I said too, I highly suspect it has a lot to do with assetdatabase v2.... I bet my 2cents on it.
     
  14. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    117
    Thought I was the only one that noticed this. I'm on 2020.1.0b15. When I deleted the library folder everything was actually pretty fast and slick. However after about an hour or two of work the project was taking 10+ seconds to enter playmode, and had like 3 - 5 minute build times, where before it was only a minute build time. Pretty much everything was slower and sluggish. I have a decently big project size but nothing crazy so this is annoying and actually a threat to productivity.
     
    Ruslank100 likes this.
  15. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Ok, so after upgrading to 2020.2a18 and then upgrading to the latest addressable has improved game start time! After reading the update note on Addressable, there was mention about fixing stuff that affecting the start time indeed!. So in my case it was partially due to bug (or issue) in Addressable. I still feel it can be improved... the release note on a18 version indicates that there is known issue for AssetBundle Loading is slower, and Addressable is based on AssetBundle so hoping to see even more "improvements"
     
  16. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    530
    Agree to the bundle loading times being an issue. I switched from resource folder to addressables and loading became significantly slower.
     
  17. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    I've noticed this but when moving from 2018 to 2019.4. Ridiculously long start times, like 2-3 minutes
     
  18. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I have project which started from 2017, migrated all the way to 2020.2 (2017, 2018, 2019 2020.1, 2020.2) in relatively short period of time. During this transition, there was not that much added in terms of assets and scripts but had many third party assets already and took long time to make sure they work on each versions so going back to 2017 to test it again is impossible now. My starting time gradually seems to have increased from anything from 2-3 sec to now almost 15 seconds.

    My current guess is that it has to do with upgrading package assets as per migration requirements and also asset database v2.

    Only "improvements" I got was from updating to the latest Addressable which fixed some delay in starting time, (like 2 seconds) but it also has mention that AssetBundle right now has some issue as well.

    So my suspicion is :

    1. Texture Atlas V2
    2. Addressable
    3. AssetBundle
    4. Package assets (all from Unity ones)
    5. Asset Database V2
    6. New Editor UI "improvements" ( the slim font and all that came out a while ago )
    7. Maybe .Net version? from 2.0 Subset to 3.5 to 4.0 to Core 2.0 ...
    8. The new debug editor mode. ( So Visual Studio can attach to Editor )
     
    ROBYER1 and andreiagmu like this.
  19. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
  20. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    Yep, the Editor Interation Profiler was practically made for this. However you could also just generally use the Profiler, targeting the Editor. Ideally running as a Windows -> Analysis-> Profiler (Standalone Process) to avoid the profiler window itself contributing to the time to enter Playmode, (or, while the Profiler window is closed, using the F9 shortcut to start profiling before entering Playmode and stopping again after).

    If you still have a revision in version control that works on previous versions, you could profile that two and compare the data using the Profile Analyzer.

    Finally, if you find that the performance regressed due to something outside of your project, please file a bug report. Any data you gathered through profiling would be valuable in the report (and can be compressed significantly by zipping btw). Speeding up the Editor Iteration times is something we're looking to improve in different ways and we certainly don't want to regress there.
     
  21. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Hi Martin,

    I just tried this. I added a space in a C# script, saved it and switched back to the editor with the standalone profiler running and targeting the editor. The first time I saw 99% in Editor loop... with no more drop down details available beyond that. Do you know why there would be no more details of the callstack showing in the profiler than this?

    Tried it a second time and got 'long running job' errors spammed in the standalone profiler log window. The profiler didn't record anything after that.

    Tried it a third time and got 'Sending message header failed' warnings spammed in the Unity editor log window. The profiler didn't record anything after that.

    I might try the editor integration profiler next when I have more time, as I am bit curious, however, in either case it sounds like bug reports have been raised before for the ~40%+ speed regression script edit and enter playmode time and closed as by design.

    Unity QA (quote from post linked above)
     
  22. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Ok just tried once more with the standard profiler rather than standalone. Here are the results showing AssetDatabase V2 script compilation taking the bulk of the time. I'm still wondering why the added 40% compilation time using the new asset database system?

    A little while back I reverted back to V1 and got my faster script compilation times back - although I didn't profile that but the total time to enter playmode from a script edit was about 6 seconds, which is less than the script compilation alone with V2.

    Screenshot 2020-07-24 at 08.21.19.png
     
  23. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    The Profiler Manual pages lists a bunch of common samples, EditorLoop among them, summarizing: If there is nothing underneath it, you should make sure you change your Profiler Target from "Playmode" to "Editor".

    Please also take note about the post by Thomas Petersen, our VP of Quality, on that topic:


    Are you on the latest 2020.2 alpha version (or latest patch version of whatever Unity Version stream you're on)? I thought we already fixed those Issues. If you are on the latest, maybe something new came up and a bug report on these would be much appreciated, you can ping me the issue IDs so I can check the reports out (since it's Profiler tooling related).

    Anyways, it'd be good to know which exact unity version you are experiencing this on and I'll ping this to the ADB2 team.
     
    jdtec, ImpossibleRobert and SugoiDev like this.
  24. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Thanks, maybe I didn't set it correctly the first time before the errors. As for the errors I'm on an old 2020.1 beta so you're probably correct that its already fixed if you've seen this issue before. I'll raise a ticket if I see it after upgrading but for now the built-in profiler seems to have shown what takes the bulk of the time anyway.
     
    Last edited: Jul 24, 2020
    MartinTilo likes this.
  25. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I am not sure and I could be wrong, but I think I saw somewhere that alpha release was supposed to be once a week. I am not trying to be picky, but was not that the plan?

    -- Edit --

    Here...

    "
    Continuous Updates
    New incremental alpha iterati ons and features will be published once a week until all major content scheduled for this version is included and the transition to beta is made."
     
  26. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Since they're readying the beta, seems like the consider the above as done.
     
  27. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Fair enough. But the updates was not exactly per week in the past neither. I am not going to drill this further since it is in the past now. Hopefully, the future alpha / beta updates are released as scheduled.