Editor load/play/stop is suddenly extremely slow! (5min+ to do anything)

All of a sudden today, loading the editor, pressing play, stopping play, etc – take about 5:00-10:00 to do.
Yes, even ending play takes a minimum of 5 minutes to get back into the editor.

This is all in my menu scene.

Just the level select area that instantiates 30 prefabs (displaying the levels) over a few seconds (it only creates 1 every few frames) lags incredibly hard.
Using deep profiling I was able to find this, but I’m not sure what to make of it:

It looks like the instantiation of the ~30 prefabs are somehow running 225,000 times this frame?!?

I ran the profiler also during the 10 minute pause when trying to play the game but could not quite understand anything in it.

However this can’t be normal, anything I can try? My game has some hard deadlines coming up and it’s literally untouchable at the moment.

Try with deep profiling enabled to get more detailed info about this stack trace.

Since the issue is coming from instantiating your prefabs, there is a high chance that the delay is caused by one of the scripts on that prefab. Try disabling components or game objects in that prefab to narrow down what may be slowing things down.

The mention of File.Read may also hint at slow disk access, possibly a virus scanner interfering. If you have one installed, try disabling it and generally it’s best practice to exclude Unity project folders from virus scanners and Windows Defender (online/live scans).

Deep profiling IS enabled.

And this is just one instance, literally doing anything. Loading up the project, turning ON deep profiling, playing or stopping. Literally anything creates a 5 to 10 minute slowdown.

(Note the instantiated objects have no scripts on them, game just creates a menu item and sets it’s text/image, these haven’t changed in a year)

It feels like an incredibly slow HDD issue, but the project is on an SSD along with my windows. Everything runs perfectly fast except for this ONE project that suddenly started doing this.

The ReadManager has over 225,000 draw calls. Is that normal?

As suggested I would definitely try is turning off any Antivirus, Windows Defender, etc.
Might also be worth opening the task manager and seeing if anything shows up while the project is loading - you might see the HDD usage going up, or a different process altogether suddenly spiking.

You could also try deleting the Library folder in case something got messed up in there.
Another option is to copy the project to another drive, just to see if there’s any difference.

Some extra info:

  • I don’t use any sort of antivirus or windows defender.
  • Same project works perfectly on another computer (Identical asset folder through svn)
  • Other projects work fine on the same harddrive
  • HDD usage all seems normal when loading it.

I definitely think there’s something wrong with the core project files themselves, not the asset folder, since the only problems is this single project instance.

I’ll try deleting the Library folder.
Is there anything similar I can try in case that doesn’t work?

Edit: Deleting the library folder did nothing, it’s still freezing and lagging incredibly hard whenever something is instantiated in game, with hundreds of thousands of calls for 1 file load.

Any ideas on why?

That’s super weird!
A few more questions:

  • Does it happen when you instantiate anything or only specific prefabs?
  • What happens if you create a new blank scene and just place a single prefab in it?
  • What happens if you create a new blank scene and add a single script that instantiates that prefab?
  • Do you have any third party plugins installed, or other packages?
  • Does it happen in a standalone player as well, or is it only the Editor?

Sorry these all might be a bit random, I’m just trying to see if there are any potential leads :slight_smile:

  1. Any time unity literally does anything there’s a 5 minute loading bar. This includes editing a script or even simply clicking or tabbing back to the editor when it was not in focus lol. So yes, instantiating anything gives a 5 minute load, and trying to load a new scene makes it hang indefinitely.
    2/3. Blanks screens are 5 min to start play
  2. Yes tons lol, but I have disabled them all.
  3. Can’t get that far, the delays are way too high.

BUT I FOUND A SOLUTION!

  1. Delete entire project
  2. Revert to a much older backup
  3. Cry
1 Like

If the project works on a different computer but its slow on yours, you can try and delete the library folder from your project, and let unity re import everything.

:frowning:

Well, if

Works it at least does mean there’s likely something in the project that causes it?
Hopefully you’re using source control, so you can diff the versions?
It may be slow, but you could “bisect” - basically once you know there’s a version that works, you take the half point between that version and yours. If the new version still works - you keep moving towards the one that doesn’t, and vice versa. That will let you find out the change that “broke” it.

Unfortunately they said they already tried that and it didn’t help.