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

is domain reload slowdown fixed?

Discussion in '2022.1 Beta' started by laurentlavigne, Mar 17, 2022.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    It went down 2x to 3X in the 2021.x branch, compilo got sped up but reloading was still much slower than 2020.1.17. We were told that work was being done which would bear fruit in 2022.
     
  2. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    youve asked two questions so far that couldve been answered by you opening unity 2020.1b
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    I can't be bothered installing every single version, like you cannot be bothered making useful contribution to this forum ;)
     
    Last edited: Mar 19, 2022
    gaps, demiurge180, LordCafe and 2 others like this.
  4. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    Sounds like a you problem. The answer is maybe.
     
  5. Ziflin

    Ziflin

    Joined:
    Mar 12, 2013
    Posts:
    132
    The answer appears to be "apparently not" and it gets worse over time. Same (relatively small) code base in 2021.2.0b4 compiled and reloaded in 2022.1.0b12 is 1.35x slower on a fresh start of the editor. After a few hours of recompiles/reloads working on code, this became nearly 2x slower. We're not using any 3rd party code and have only a few [InitializeOnLoad] attributes.
     
  6. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    524
    We're not using the 2022.x betas but I'm keeping an eye on the forums. I hope there's light down the tunnel somewhere and something is improving because the Unity 2020 and 2021 editor experience is becoming more glacial every day. I'm stating the obvious, but the script compilation, play times and stop times in 2021.2.latest are frustratingly slow compared to earlier versions. (I realise I should be jumping into the 2022 beta and comparing some projects but we don't have time for that at the moment, sorry!)

    Everyone's project and hardware is different so this is anecdotal, but currently in 2021.2.16 on a 2018 MacBook Pro a small HDRP project with 2 plugins active (Amplify Shader, DOTween) takes me about 25-30s to enter play mode where the scene contains a single mesh asset and whatever HDRP assets/configs are needed for the default lighting etc. so it's minimal at best. It certainly feels slower to do anything in the editor vs 2020.3 LTS projects, which were in turn slower than 2019 and 2017 projects.

    Yep, I know that fast domain reloads (edit: "Enter Play Mode Settings") are a new feature but it's not practical to refactor existing projects or when using a few Asset Store or external dependencies that don't support it.
     
    Last edited: Mar 24, 2022
    laurentlavigne likes this.
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    I'm not sure if you're aware of it, excuse me if I tell you something you already know.

    Unity implemented "Enter Play Mode Settings" in Unity 2019 that allow to skip the script and scene reload when pressing Play, which makes entering and stopping play mode almost instantaneous:
    1. https://blog.unity.com/technology/enter-play-mode-faster-in-unity-2019-3
    2. https://forum.unity.com/threads/configurable-enter-play-mode.768689/
    However, it does not fix the reload time when changing a script.
     
    mahdi_jeddi likes this.
  8. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    524
    Hey Peter, thanks - yeah I mentioned that at the end of my post (sorry, called it fast domain reloads, I meant fast play mode). We're aware of the fast play mode stuff that avoids the domain reload but obviously all of your project and plugins and packages need to play by the same rules, so it's a useful feature but not practical in every situation.

    Also, I'm not using any new Apple Silicon hardware myself but I have heard good things about the speedy performance of the native Unity 2021.x editor. Is anyone else here using 2022 beta on Apple Silicon hardware, and if so, how is the performance?
     
  9. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    438
    yeah, try that in a production. I mean any, that is using some 3rd party assets. It is impossible to work without domain/scene reload when it's not supported by every asset out there. It's one of the features that "theoretically" makes sense but in real-life scenarios isn't possible in my opinion. Besides the whole idea seems like a band-aid, not the real solution. Despite the fact that (as stated before) - it isn't really usable.
     
    Prodigga and laurentlavigne like this.
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,797
    I kinda blame those features for play times getting slower again. Makes me feel like Unity thinks going to play mode is fast now, so they can slip up again when it’s convenient.
     
    Alic, joshcamas, nehvaleem and 2 others like this.
  11. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    Quick test on a 2k LOC proto: domain reload is now only 30% slower than 2020.1.17
    Not bad at all.
    Still regression but finally going in the right direction.
     
    DragonCoder and mahdi_jeddi like this.
  12. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    438
    sorry if I sound silly right now but what is 2k LOC proto? :) domain reload time is pissing me off so hard that I am trying to grasp every bit of information out there :)
     
  13. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    the least amount of assemblies (including asmdef and thus packages too) is what helps most with reducing the domain reload time @nehvaleem but ive also seen some projects abuse initialize on load and then attribute that to the domain reload because unitys progress bar doesnt update as a separate process
     
  14. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    438
    yeah I know, I try to minimize use of the assemblies (I think I know how they work, when to use references, when to use separate assemblies) and I do not use initializeonload almost at all. Still the domain reload is pita on larger projects
     
  15. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    Not at all, some times I write too tersely and acronyms are not helping. It means game prototype of only 2000 line of code (LOC). In fact after installing the statistic plugin the project is 21kLOC, 10x what I thought. Still a very small project.
     
    nehvaleem likes this.
  16. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,701
    Out of curiosity, how do you read\calculate the number of code lines?
     
  17. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    DragonCoder likes this.
  18. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    fo you to know, we are using unity 2022 beta and we still having the exact waiting time after compilations, or even more

    3m and 30s for compiling a single script that is in a super small separated assembly
     
  19. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    438
    this is ridiculous
     
    ericpug likes this.
  20. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,701
    Have you used the special profiler to identify which step takes that time?
     
  21. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    Editor iteration profiler seems to be not supported anymore so im trying to do that with the unity profiler, but hard to get that info when it gets stick soo much memoryinvolved to get the data

    the last code compilation i did finished after the 8:29 mark
    this is horrible, my boss' PC is just faster it "Just" takes 1 minute, and is a top hardware PC, mine too

    we can not wait more than 50 times every day per week, having an average of 3 minutes per compilation that makes 1150 minutes per week, thats a total of 19 HOURS lost every week!!!!!! What the hell, thats like 2,5 working days every week, im losing half week of work at the office, working 8 hours at day
    2.5 days unity, this is driving me crazy!!!!
    this is literally half of my working day every day!

    and i cant even profile this because unity explodes when trying to get the profiler data of this colossal time wait

    upload_2022-4-8_9-55-46.png
    upload_2022-4-8_9-55-25.png upload_2022-4-8_9-56-25.png
     

    Attached Files:

  22. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    Here it is without Deep Profile, because with deep profile i cant even see the data
    i dont know why this is taking so much time...
    upload_2022-4-8_10-48-40.png


    Also sometimes the data disapear because of yes!
    View attachment 1035221
     
  23. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    This is what's happens when I try to compile with the profiler in deep profile mode
    Also 27 mins after block disipates


    IMG_20220408_112509.jpg
     
  24. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    Once the block disappear i get this and it doesnt seems to end, even if it ends i will not be able to stop the profiler at time because it will freeze a bit while painting the graph 1649411594561600631730791174790.jpg
     
    Thygrrr likes this.
  25. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    Has anyone found a solution to this issue, or a way to mitigate it?

    2022 seems to be a lot worse than previous LTS for me, even when using assemblies etc.
     
  26. Ziflin

    Ziflin

    Joined:
    Mar 12, 2013
    Posts:
    132
    @Occuros - Nope. It seems slower and slower each time I update Unity based on the timings I log. What's also annoying is that the longer Unity is open, the worse it gets with the domain reloading.
     
  27. APTEM59

    APTEM59

    Joined:
    Dec 27, 2019
    Posts:
    27
    Updated unity to 2022.2.1f1 and now cause of domain reloading, script compiling takes for 20-30 minutes, it's insane lol
     
    ericpug likes this.