We have some weird behavior with our game in the editor, In Unity 5.5.3f1 64bit (although we had this with all previous versions too).
I’m pretty sure it’s something that we do wrong, since I don’t have this behavior in other games. So something causes what I’m about to describe, and I hope someone can give me a hint in the right direction.
When compilation is done (after changing a script), the editor freezes several (+/- 15) seconds, see:
Notice that the last file event in the image is for the Unity.IvyParser.config file at 22:04:18 and then suddenly the events stop and then resume at 22:04:33, that’s the period when Unity is inactive.
If I then right click anywhere in the editor or try to open a menu item, there is an additional wait of about 10 seconds:
This time there are events in process monitor, there is network communication, however, the editor is not responsive in the meantime.
As said, this probably is caused by some script/configuration in our project since we don’t have this in other projects. This is quite a large project (a few GB’s), while the others are only in the MB’s, so maybe the project is just becoming too big?
I tried removing all possible editor scripts that we have, but that didn’t help unfortunately. Kicking out most of the assets didn’t help either.
Another reason why I’m quite sure it’s our code: when there is an compilation error (and the code can’t be loaded), Unity becomes very responsive again.
In the editor log it reads: “- Completed reload, in 15.110 seconds”, which matches the 15 seconds of inactivity in the process monitor.
I’ll be posting ideas and progress here in case it helps anyone. If you can help me, let me know!
I tried adding parts of the game to a new project, to see which part would introduce the delays.
There was no part that increased the delays by a lot,
Now that I have some parts of the project copied over, I’m seeing the same delays, but smaller…
Meaning they’ll grow bigger if I make the project larger… would this be an issue in Unity after all?
disabling our Version Control plugin in Visual Studio (Perforce in our case)
The incremental compiler seems to have a small effect on the initial compile time, maybe cutting it down with 2 seconds.
The other suggestion don’t seem to have any effect, leaving the freeze after compilation unchanged.
Happy to report that the wait times in 2017.1.2f1 seem to be fixed. Of course there’s still a compile time, but after that there are no more unexpected waits…