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

Feedback (Case 1161373) 2019.3: Enter playmode time significantly increased

Discussion in '2019.3 Beta' started by Peter77, Jun 9, 2019.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    The time the editor requires to enter playmode significantly increased in Unity 2019.3 compared to Unity 4.6.



    Reproduce
    • Create new project
    • Create new scene
    • Press Play
    • Write down how long it took to enter playmode
    • Repeat these steps with Unity 4.6 and Unity 2019.3

    Actual
    Entering playmode in an empty project takes significantly longer in Unity 2019.3 than in previous Unity releases.

    In my test:
    Unity 4.6 = 2 seconds
    Unity 2019.3 = 5 seconds

    Expected
    Newer Unity versions should not be slower than older ones.

    Note
    Please use hardware similar to the PC I used to submit the bug-report with. It probably can't be reproduced on high-end machines.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    QA replied, unfortunately not really what I was looking for:
     
  3. Justinasg

    Justinasg

    Unity Technologies

    Joined:
    Mar 10, 2017
    Posts:
    5
    Hi Peter,

    We're also further investigating this issue.
    For now there's no issue tracker link that I could provide.
    But the issue is reopened and QA is taking a deeper look into it.

    Thanks again for your time reporting issues that you encounter!
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    Last edited: Jun 21, 2019
  5. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
  6. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    957
    Oh boy, did I find that hilarious... In a big project with loads of assets using the addressables system, entering play mode has taken up to 2 minutes... I had to get a newer PC to get it down to 40s...

    I'll try with this feature to see what difference it makes on this project.

    Edit: Unless not reloading the domain stops addressables from rebuilding its data, it will not help. Just profiled it, 8 seconds are actually spend entering play mode, 6.5 of which are the domain reload. All of the rest is Addressables.BuildScriptFastMode.BuildData().

    Edit Edit: Goodness... just found the culprit for our load times... It's an innocuous line of code in Addressables that does nothing useful on our particular project and costs 28 out of 28.5s of that build step... :-s Gotta check whether that's fixed in newer versions and report a bug if not, this has singlehandedly cost our company weeks of productivity.
     
    Last edited: Jun 27, 2019
  7. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    505
    Were you able to find it in the profiler easy enough?
    What would be the ideal workflow for you to solve this issue?
     
  8. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    957
    It was easy in terms of finding the culprit itself in the profiler data, but slightly awkward to actually record.

    Had to start recording, press play, wait for half a minute and then stop recording before the relevant frame fell out of the buffer.

    This is easier when recording normally, since clicking anywhere in the profiler data pauses play mode. With Record Editor, you need a well aimed click with a solid deadline to stop recording.

    Some sort of trigger system for starting and stopping recording would make this a breeze but something as simple as stopping recording when Record Editor is enabled if a frame is selected would be good QoL improvement.

    Now for the issue itself, I started a thread in the addressables forum:

    https://forum.unity.com/threads/add...ntrycollection-support-massively-slow.701798/

    I would have preferred to submit it as a bug but it's an issue of scale, so producing a stand-alone repro would be quite difficult, as it requires a lot of sizeable assets to get to a serious slowdown. Not sure what the workflow could be on that end. Maybe just submitting profiler data but that would be tricky for QA to do much with.
     
    Last edited: Jun 28, 2019
    phobos2077, Ony and alexeyzakharov like this.
  9. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    This would be extremely nice to have.
     
  10. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    90
    I heard rumors about Unity is targetting a state change time for entering play mode below 1sec for the 2019.3 tech branch...
     
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,102
    Thanks Alkis! You should be able to see some activity in your thread soon.
     
    phobos2077 and AlkisFortuneFish like this.
  12. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    390
    charlesb_rm likes this.
  13. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    phobos2077 and alexeyzakharov like this.
  14. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    505
    As I can see in the system the fix version is 2019.3.0a12 and backport is 2019.2.7f2.

    PS: According to our perf tests data enter playmode on empty projects on i7-4930K (Windows) takes
    1. 2020.1a13 - 1.7 seconds.
    2. 2019.3b12 - N/A.
    3. 2019.12f1 - 1.5 seconds.
     
    Last edited: Nov 14, 2019
    Peter77 likes this.
  15. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    Thanks for the quick reply. I'm going to take a look at it with b12, once released though, and report the results here. Can hardly wait to see how it improved! :)
     
    alexeyzakharov likes this.
  16. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,102
    There was a typo in @alexeyzakharov 's reply. The fix didn't land in b12, it landed months ago in a12.
     
    phobos2077 and Peter77 like this.
  17. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    UI BUG DESCRIPTION
    Unity 2019.2.12f1 always take 5sec to start in Play mode.

    Environment
    Hardware Device:
    i7 2600k, GPU GTX 1080Ti, 24Gb Ram,
    Hardware Device: i5 9600k, GPU GTX 1080Ti, 32Gb Ram,
    OS: Windows 10 64bit ()

    Severity
    Customer Impact:
    normal bug (always)

    Note
    4 min per day per user. If 100.000 users press 50 times Play button per day per 5sec = 25.000.000 sec = 290 days or one year of human life lost waiting for Unity to start per day.

    @alexeyzakharov @LeonhardP Hello World: As an example to understand how long
     
    Last edited: Nov 14, 2019
    KarlKarl2000 and alexeyzakharov like this.
  18. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    505
    Yes, yes, exactly! That's why we are proposing to switch to enter Play Mode without domain reload - this significantly reduces time to start Play.

    This is what we are trying to fix starting from 2019.3. I've got very similar similar numbers mentioned in the alpha doc for 2019.3 "configurable Play Mode" feature :) (Also: https://forum.unity.com/threads/configurable-enter-play-mode.768689)
     
    AlanMattano likes this.
  19. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    I've just tested 2019.3.0b11 and it's not fixed in my opinion. Entering PlayMode in an empty scene with b11 takes 4s vs 2s in Unity 4.6, so it's still twice as slow.

    upload_2019-11-15_19-40-35.png

    PS: As I wrote earlier, please use hardware similar to the one I submitted the bug-report with. You most likely can't reproduce this on higher end machines.
     
    KarlKarl2000 and phobos2077 like this.
  20. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    390
    Hi Peter. Many thanks for your sterling efforts in profilng and documenting the decline in editor performance over time. This is very valuable imho. Have you had a chance to try out the newer "enter playmode without domain reload" functions yet? Do these offer any improvement in your view? Thanks!
     
    Peter77 and phobos2077 like this.
  21. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    I've tested 2019.3.0f1 which continues to be significantly slower in "EnterPlayMode" than earlier Unity releases as written in the first post.

    I've updated the bug-report Case 1161373 with a profiler capture. I hope it helps to solve the problem.

    enter_playmode_1.png
     
  22. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    Yep, it's a nice improvement and enters playmode pretty much instantly in an empty project.

    The downside for me is that it requires to write your code in a way that this system can handle. For existing projects, it's often not as simple to support the new instant playmode. That's why I would like to see at least the performance of earlier Unity releases, so I don't have to rewrite existing projects to have acceptable timings.

    For new projects, I believe it's great if you use it right from the start. Then you can write all the code right from the beginning with instant playmode in mind. So it's definitely an appreciated feature, just not for existing projects in my case.
     
    Last edited: Nov 28, 2019
    phobos2077 likes this.
  23. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    390
    Thanks Peter, very useful feedback as always!
     
    phobos2077 and Peter77 like this.
  24. Justinasg

    Justinasg

    Unity Technologies

    Joined:
    Mar 10, 2017
    Posts:
    5
    @Peter77 Thanks for replying to a bug report with your findings. As Leonhard mentioned, it was verified back in August with 2019.3.0a12. Possibly there were some additional performance regressions between a12 and 0f1.

    The bug that you replied to should be looked at again by our team :)
     
  25. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    I've tested 2019.3.0f3 which continues to be significantly slower in "EnterPlayMode" than earlier Unity releases as written in the first post.

    upload_2019-12-12_7-0-54.png
     
  26. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    @Unity_Javier sent me an early build of 2019.3.0f4, which comes with various performance improvements. The editor does feel faster than earlier Unity 2019.3 releases, but there are still a few things that should get ironed out.

    Unfortunately, "EnterPlayMode" (in a new/empty project) didn't improve in this version compared to the previous beta release. It still takes significantly longer than Unity 4.6.

    upload_2019-12-16_10-55-23.png
     
    KarlKarl2000, Storm4_ and TextusGames like this.
  27. hertz-rat

    hertz-rat

    Joined:
    Nov 3, 2019
    Posts:
    71
    I wanted to add that this isn't just a 3 second time increase. If you put it into HDRP mode and add a scene with only a couple thousand lines of code, it takes 18-33s to enter playmode (usually 22-25 with no c# script changes).
     
  28. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    "without domain reload"
    Please make a video tutorial in Youtube.
     
  29. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    • But trigger more hiding bugs
    • There are spelling errors and difficult to understand when to use it:https://docs.unity3d.com/2020.1/Documentation/Manual/DomainReloading.html
    • [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] is to long consider: [Reset]
    • But looks complex. Must be for stupid prove. Probably I will fail to understand when to add the attribute.
    • So use the Right-click button to trigger this special Play Mode
      Right-click = Play Mode without domain reload
     
    alexeyzakharov likes this.