Yea, I profiled it, most time is searching through the asset database and launching all assets, such as
Text Mesh Pro, which seems to generate Meshes after recompile,
ProBuilder, which also seems to create meshes,
New Input System, which builds objects (classes for event handling, I guess),
Even the Loading Bar gets updated after a recompile.
And all classes getting deserialised, all scripts on all objects - so the old ones are thrown away, causing massive loads of garbage that has to be cleaned up and that takes a big chunk of the recompile time.
And of course all the assets from the assetstore that implement [SerializeOnLoad] or [SerializeOnLoadMethod] - all these methods are called and all those assets initizialize their system, Gaia, Odin, Peek, and your custom tools, if you’ve written any.
Thats the recompile.
While using the editor - it depends. You can profile this on your own by switching the profiler to “Editor” on the top left dropdown field. In our case, it was a custom tool, that caused some lag, the editor itself (V 2020.1.17f1) runs quite smoothly and we have 29 Scenes, all loaded at the same time with a total of 104,376 individual GameObjects.
Looking in certain directions causes a lag sometimes but thats on the GPU side, as far as I can tell.
Opening an inspector can take some time too, a second or two … but the core workflow of moving stuff, looking at stuff, navigating the scene view camera is actually quite smooth.
Recompile takes 30 sec which is quite horrible for me, the programmer xD
So I guess you have to profile it.
Btw. My PC is 5 years old by now, got a new GPU ( 3070 ) but everything else already quite old, so maybe thats a bug on your side?
Possible improvements:
- Reducing the size of the assetdatabase by deleting assets you don’t use.
- Not having 100k Objects visible at the same time (unloading some scenes)
- Checking 3rd party assets and custom tools if they affect the editor performance and removing them from the project, if possible
- getting better/faster hardware, CPU with strong single core speed, as a lot of the editor runs on one thread + super fast SSD as well as a good GPU, depending on your game