Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Speeding up load time of Unity itself

Discussion in 'Editor & General Support' started by LoekvanKooten, Feb 1, 2019.

  1. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    I have 64 MB of RAM and am reading from an SSD, but with more than 70,000 files and 40 GB in the Assets folder, Unity takes a very long time to load (up to 40 seconds). Thing is, I may need all these assets sooner or later, but they don't all need to be read or checked. Why doesn't Unity keep tabs of only the files that are needed in the scene?

    Total noob question probably, and I'm probably missing something.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,419
    40 GB in the assets folder? That is a LOT. And 70,000 files is a LOT. If you don't need them in your project, probably best to delete them. When you need one, you add it back in. Back up your project first, and delete away! Or, start with a new/empty project and ONLY add the assets that you need.
     
    LoekvanKooten likes this.
  3. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    @JeffDUnity3D Thing is, these are files installed automatically by assets from the Unity Asset Store in the Assets folder. I can of course randomly start deleting files I don't use, but often there are dependencies. What would be the easiest way to handle this? Unity itself knows which files it is actually using in a build, right? If not, what would be your approach? Thank you in advance!
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,419
    No, Unity should not be "automatically" adding 40GB of assets, can you show a few screenshots? I suspect what you mean, you add an asset that you DO need, and the asset comes with a bunch of stuff that you DON'T need, like demos, etc?
     
  5. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    @JeffDUnity3D Sure! Most of these are graphics and music pools I use to drag assets from to the project.

     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,419
    So YOU added them, not Unity. You only add the assets that you need! What is a music pool? If you create a brand new project, all those assets are not there, correct?
     
  7. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    @JeffDUnity3D I'm probably missing a very basic concept here, but I have an Assets folder. Whenever I buy a new asset in the Store, it tells me to Import said asset, pointing to the Assets directory. Are you saying I should put them somewhere else in another directory that is not called Assets? I have to put them somewhere, as they are used in the scene.

    The music pool just contains wav files.

    I assumed Unity would ignore whatever is not actually used in the scene? That still leaves the question: what if files are depending on each other? For wav files that question is easy to answer, but for a huge system like Vegetation Studio, that is far more complicated.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,419
    No, if you buy a new asset, you don't need to add it to your project unless you want to use it! It is always available in the Asset Store when you DO need it. If you do need the asset, then yes of course you need to include the asset. Are you actively using ALL those assets? Then don't add them in the first place, only add them when you need them. You seem to be using this project to store every asset that you have purchased which is not necessary (unless you need to use the asset). You can purchase assets, own them, but not include or import them in your project until you need the asset. I hope this clears things up.
     
  9. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    @JeffDUnity3D I use elements of all of them in the actual scene, that is the problem. Not one asset is not used. Is this a peculiar way of working?

    So basically I'd need to become more critical towards assets that are easy to split, say the wav files, while leaving more complicated assets, like GAIA and Vegetation Studio, alone. Is that correct?
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,419
    I understand your issue better now. I originally thought that you had a ton of assets that you are not using, and you were just using this project to "store" all your assets, used and unused. So don't delete anything! I had mentioned previously "I suspect what you mean, you add an asset that you DO need, and the asset comes with a bunch of stuff that you DON'T need, like demos, etc?" which looks to be the case. I might suggest that you find which assets are using the MOST space, and contact the developer to see which files are actually needed. GAIA and Vegetation Studio have tons of large files that you probably don't need. And all this assumes that an empty project loads immediately, but this larger project takes all of 40 seconds (which isn't bad at all!). I've had project that take HOURS to load.
     
    LoekvanKooten likes this.
  11. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    I got your message loud and clear! 40 seconds doesn't sound too bad I guess, reading the above ;-) Thank you very much for your help!
     
    JeffDUnity3D likes this.
  12. boban_

    boban_

    Joined:
    Dec 18, 2018
    Posts:
    12
    Ah, 40 seconds! I envy you! I have quite beefy machine, almost the same project size (38G, I see from your screenshot that we use lot of the same asset:) ) and it takes 15 minutes to load. I guess SSD makes a huge difference. Maybe I'll move the project to SSD and check if it improves. But what I would like to see from Unity is to put some love on this aspect (and asset management in general, now it is really bad).
     
    LoekvanKooten likes this.
  13. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    I guess I'm just really spoiled then :D Originally the project was on a normal HDD, but I had to give up on that really soon already, as loading it was taking ages. Moving it to SDD greatly improved the situation, but indeed, now even there it's taking 40 seconds. That said, I don't expect to add more really big monsters like GAIA and stuff: from now on it will just be small stuff like materials and the occasional prefab, so the loading time hopefully won't get longer.

    A very annoying issue was the fact that assets files can't be bigger than 4 GB, so that I had to spread my assets over multiple scenes (which is a lot simpler than Unity's suggestion to use their Asset Management tools, which look way too complicated to a novice like me).I still find it baffling that Unity has this limit, even though it claims to be 64-bit.
     
  14. boban_

    boban_

    Joined:
    Dec 18, 2018
    Posts:
    12
    @LoekvanKooten I finally did move the project to SSD after your advice. Now it loads so fast :D like in less than a minute :D. Thanks! :D

    btw. I did manage to speed the load time even more. after I set up the scenes I wanted I removed lot's of the ground textures - they take up a lot of space (I saved 16gb, so reduced the project size by half!).
     
    LoekvanKooten likes this.
  15. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    @JeffDUnity3D By checking Override for PC, Mac & Linux Standalone for two textures (each 350 MB in build) and changing Max Size from 4096 and 8092 to 1024 and 2048 respectively, build size went from 14 GB to 4 GB. Apparently this triggered the "Determing assets that need to be reimported for target platform" routine, that shrunk all the assets back to their original size.
     
    JeffDUnity3D likes this.