I used Unity 5.6.0b2 to run a few editor performance tests to find out how much impact the number of empty game objects in a scene has on the time that the editor requires to open and save a scene, as well as enter and exit playmode.
The results seem to show that the time does not scale linearly with the number of game objects.
For example:
The editor requires 3.6 seconds to enter playmode from a scene with 10000 empty gameobjects on my computer. Having a scene with 50000 empty gameobjects requires 171 seconds to enter playmode. Itâs 5 times more empty game objects, but almost a 50 times longer wait.
I tested the project on a SDD and non-SSD hard-drive, as well as with enabled and disabled anti-virus software. The results were pretty similar at all times. Unity disk-activity during the Open- and Save-Scene tests was also very low, I donât think itâs IO bound.
The project and tools that I used to run the tests are attached to Case 863912, in case someone wants to take a look at it.
Open Scene
Represents the time, in seconds, how long it takes the editor to open a scene with N objects. These game objects are either empty GameObjects (earlier created via new GameObject) or empty prefab instances (earlier created via InstantiatePrefab). Empty in this case means the game object has only the Transform component. The duration has been measured in Force-Text and Force-Binary asset modes.
Save Scene
Represents how much seconds the editor requires to save a dirty (EditorSceneManager.MarkAllScenesDirty) scene. Notice how fast âPrefab Instance (Binary)â saves, Iâm not what happens there.
Enter Playmode (aka Play)
Measured using the EditorApplication.playmodeStateChanged callbacks. Itâs how long it takes the editor to switch from edit mode to play mode (Press Play).
Whatâs interesting with the âEnterPlaymodeâ thing is that it seems the editor has twice as many âAwakeFromLoadâ calls than game objects in the scene. For example, the following image shows a profiler snapshot of a scene with 20002 game objects in total, yet it displays more than 40000 AwakeFromLoad calls.
Leave Playmode (aka Stop)
Represents the amout of time the editor requires when pressing Stop. That is the time to switch from playing to edit mode.