#EditorSceneManager.BackupScenes happening every single Play Mode Enter when it shouldn't?

1 messages · Page 1 of 1 (latest)

calm stag
#

The impression I got from this unity issue tracker: https://issuetracker.unity3d.com/issues/editorscenemanager-dot-backupscenes-saves-non-dirty-scenes-when-entering-play-mode
is that Unity was previously bugged in running this every time a scene entered play mode, not just whenever it was dirtied. This was fixed supposedly, with the user expecting this to run 0 times in an undirtied scene.

In my case, it is occurring on every play mode enter, taking 100+ms of time every single play mode (image 1). I thought maybe this is simply an issue with my current project with something maybe hidden dirtying in some way, so I made a completely new and fresh project with nothing extra installed to it on the same version, (image 2) and still, same result, only there is much less to back up obviously.

I might just not understand what this code is for (from my understanding it is so Unity has a scene to return to after entering play mode), and am misunderstanding the issue tracker, but I'd appreciate any help on this. I don't understand why this would need to run more than once if not yet dirty from the previous save. This might be a bug, I'd appreciate if anyone could try running the profiler themselves and see if it happens to them too on modern versions. Thanks.

On Unity 6000.0.50f1

north rose
#

Could be a regression. What Unity version are you using?

#

Also, seeing the profiler hierarchy expanded in an empty scene might also be useful.

calm stag
#

I kept it open so its the same one

north rose
#

To me it looks like it's just loading the existing backup file to check if it's up to date. Not doing actual redundant work.

calm stag
#

Oh so that's normal then?

north rose
calm stag
north rose
#

I mean the engine source code

calm stag
#

right okay

#

Does the issue tracker I posted make sense to you? It sounds to me like the saving code shouldn't be happening at all

calm stag
# calm stag

Expanded version of my current project as well to compare more

#

The 163ms on every start is substantial especially if it's not necessary or supposed to be happening

north rose
# calm stag Does the issue tracker I posted make sense to you? It sounds to me like the savi...

The issue only says that there shouldn't be an actual save happening. It's quite possible that the method is still called and just returns early if the saved files is in the same state.

Though, looking at the profiler again, I see file.write as well, which might imply that there is actually saving happening. So perhaps the bug just resurfaced again.

What unity version are you using?

calm stag
#

And yeah I noticed the file.write too

#

I also doubt it'd cause so much GC if it was just skipping saving but that's just a guess

#

I have also made a script to check if the scene is being dirtied and I can check the scene itself and it has no * next to it when this happens.

#

And this happens in a fresh project too anyways, which I assume couldn't have that issue.

north rose
calm stag
north rose
#

Yeah. That's why I'm talking about a regression.

calm stag
#

It's just weird that nobody else seems to be talking about this anywhere I can find online except that thread

#

I could try making a brand new project on the latest LTS and test if it still happens there but I thought others would've come across this if it's literally happening in fresh projects

north rose
#

I guess it's not bothering people enough to talk about it. I never noticed anything like that. Let me test in my project.

#

Yeah, I do see it in my project as well. It's just a very minor part of other work that is happening on the first frame, so it never bothered me.

#

I guess it's more noticable in scenes that have a lot of objects and complex hierarchies and other serialized data.

calm stag
#

Is your project in a version more up to date? I guess you don't have too much in your scene?

#

thanks for checking this for me btw

north rose
#

6.3.7f1