Search Unity

Question Reduce loading times

Discussion in 'Editor & General Support' started by theCodeHermit, Mar 6, 2023.

  1. theCodeHermit

    theCodeHermit

    Joined:
    Sep 20, 2018
    Posts:
    39
    Open project => Wait
    Start / stop game => Wait
    Change script => Wait
    Move object from project view => Wait
    You blink too often => WAIT even more !

    And so on and so on.....
    And the bigger the project gets the more you have to wait.

    I feel like I am going insane with all this waiting. I am seriously loosing my sanity here when even the slightest thing requires a million of years loading time.

    What I have done so far to mitigate all this:
    • Use Hot reload for partially reducing script reloads
    • Enabled manual project refresh instead of automatic one from visual studio
    • Enable "enter play mode" and disabled "reload domain" and "reload scene"
    • Disabled autosave/refresh for light baking
    • Disabled prefab auto save

    What I want to find out:
    • Is there a way to boost allocated memory to Unity ? It isnt an elegant solution but it will be a good start.
    • How to disable the automatic Unity reload every time I move a script inside the Project window ?
    • Any other way to speed up this cursed program before I loose my sanity completely
    Edit: My PC isnt that old or lacking of power so buying a new one is not going to solve anything.
     
    Last edited: Mar 6, 2023
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    Remove all packages you don't need, though I feel like I already suggested this to you in another thread. Clear out the library folder periodically too.

    Otherwise you're already doing about as much as you can.

    Unity already uses as much memory as it needs. Giving it more won't do anything.

    You don't. Unity needs to recompile if you move script assets.

    Put your project on an NVME drive if possible. The faster the drive, the better.

    What is your hardware though? And how large is the project?

    Even in my largest project domain reloads are 1-2 seconds; but I'm running off some beefy hardware.
     
  3. theCodeHermit

    theCodeHermit

    Joined:
    Sep 20, 2018
    Posts:
    39
    I know, though I want to make all my changes and then do a manual refresh. This way I wont have to do a separate reload for each file.

    CPU : Intel(R) Core(TM) i7-7820X CPU @ 3.60GHz
    Ram : 32.0 GB
    V_Card : NVIDIA GeForce GTX 1080 Ti

    Specs aren't new but I don't have problems running anything else. I was hoping I can allocate more power, but I guess unity has a limit on what it can use.
    What is your hardware and do you have too many plugins ? I can only dream of 1-2 sec loading times.

    During the years I have added lots of plugins so I suspect its them who slow everything down. I am using pretty much all of them though and cant remove them. What do you mean by how large ? If you mean file size it is just 8GB. That isnt big is it ?

    I didnt knew this was a thing honestly. Will check it out. Currently I have SSD.

    Edit: Heh I just checked it out and it seems I already had it xD
     
    Last edited: Mar 7, 2023
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,183
    Your processor is six generations old. In synthetic benchmarks it scores a 2,540 single-threaded and a 17,222 multi-threaded whereas the latest generation i9 scores a 4,684 single-threaded and a 60,018 multi-threaded.

    Synthetic won't exactly align with real applications but that's potentially up to 1.8x the performance for single-threaded and up to 3.5x for multi-threaded. Buying a new computer in this case would absolutely help.
     
    Last edited: Mar 7, 2023
  5. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    Moving an asset (any asset), forces an asset database refresh, which, if any code assets have changed/moved, will cause a domain reload.

    Not a slouch, but a 5 year old CPU nonetheless. I was using an i7 5960X for a while with Unity, and was getting long domain reloads. Since updating to an i9 12900kf, domain reloads have practically vanished.

    The way modern CPU's work give them major advantages over old ones.

    NVME drives, depending on the model, are roughly 10x faster than an SSD. SSD's are pretty much old tech at this point, same as HDD drives being old when SSD's became common place.
     
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,183
  7. theCodeHermit

    theCodeHermit

    Joined:
    Sep 20, 2018
    Posts:
    39
    Well yeah xD But I was hoping I can tell it not to do that.


    How long loading times did you used to have before ?
     
  8. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    That would make no sense. As moving an asset, and the asset database not updating, would show the asset in its original location. It's just the way it is.

    10-20 seconds on a decent project. The same project, using Unity 2020 reloads instantly now. My biggest project using 2021 reloads in 1-2 seconds.

    Also, forgot to respond to this part:
    I only use two addons (code-heavy ones at least), Odin Inspector and UniTask. The rest of the plugins I use I make myself.
     
  9. theCodeHermit

    theCodeHermit

    Joined:
    Sep 20, 2018
    Posts:
    39
    Ah I see, so pretty much the same as I do now. Maybe upgrading wont be useless after all.

    Hah yeah I reached that conclusion too. I ended up spending far too much time modifying plugins to do what I wanted. It would have been faster and easier to just make them from scratch xD But yeah.. I am too far in to do that now.
     
  10. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    At the very least invest in an NVME drive if your motherboard has a slot for one. A 1TB NVME drive doesn't go for much and should make a noticeable difference.
     
  11. sun3matthew

    sun3matthew

    Joined:
    Jul 12, 2019
    Posts:
    1
    In case someone ever stumbles upon this where you're developing a lightweight game on mac, you can disable many core packages. I cut it down from 5 - 10 seconds to less then a second. I was able to remove 90% of the core packages (including the built in ones). I think the big ones for me were URP and Physics, which I was able to remove.