(Case 1161373) 2019.3: Enter playmode time significantly increased

The time the editor requires to enter playmode significantly increased in Unity 2019.3 compared to Unity 4.6.

Reproduce

  • Create new project
  • Create new scene
  • Press Play
  • Write down how long it took to enter playmode
  • Repeat these steps with Unity 4.6 and Unity 2019.3

Actual
Entering playmode in an empty project takes significantly longer in Unity 2019.3 than in previous Unity releases.

In my test:
Unity 4.6 = 2 seconds
Unity 2019.3 = 5 seconds

Expected
Newer Unity versions should not be slower than older ones.

Note
Please use hardware similar to the PC I used to submit the bug-report with. It probably can’t be reproduced on high-end machines.

18 Likes

QA replied, unfortunately not really what I was looking for:

4 Likes

Hi Peter,

We’re also further investigating this issue.
For now there’s no issue tracker link that I could provide.
But the issue is reopened and QA is taking a deeper look into it.

Thanks again for your time reporting issues that you encounter!

8 Likes

Thank you for re-opening and further investigating the issue. I’m looking forward for any improvements in this area.

https://issuetracker.unity3d.com/issues/2019-dot-3-and-2019-dot-1-streams-are-significantly-slower-when-entering-the-play-mode

4 Likes

Charles posted a document in which the new Enter PlayMode optimization features are explained as well as what’s slow in the current implementation. It’s related to this thread and an interesting read, so here is the link for all people who follow this thread:

Oh boy, did I find that hilarious… In a big project with loads of assets using the addressables system, entering play mode has taken up to 2 minutes… I had to get a newer PC to get it down to 40s…

I’ll try with this feature to see what difference it makes on this project.

Edit: Unless not reloading the domain stops addressables from rebuilding its data, it will not help. Just profiled it, 8 seconds are actually spend entering play mode, 6.5 of which are the domain reload. All of the rest is Addressables.BuildScriptFastMode.BuildData().
Edit Edit: Goodness… just found the culprit for our load times… It’s an innocuous line of code in Addressables that does nothing useful on our particular project and costs 28 out of 28.5s of that build step… :-s Gotta check whether that’s fixed in newer versions and report a bug if not, this has singlehandedly cost our company weeks of productivity.

6 Likes

Were you able to find it in the profiler easy enough?
What would be the ideal workflow for you to solve this issue?

It was easy in terms of finding the culprit itself in the profiler data, but slightly awkward to actually record.

Had to start recording, press play, wait for half a minute and then stop recording before the relevant frame fell out of the buffer.

This is easier when recording normally, since clicking anywhere in the profiler data pauses play mode. With Record Editor, you need a well aimed click with a solid deadline to stop recording.

Some sort of trigger system for starting and stopping recording would make this a breeze but something as simple as stopping recording when Record Editor is enabled if a frame is selected would be good QoL improvement.

Now for the issue itself, I started a thread in the addressables forum:

https://discussions.unity.com/t/748712

I would have preferred to submit it as a bug but it’s an issue of scale, so producing a stand-alone repro would be quite difficult, as it requires a lot of sizeable assets to get to a serious slowdown. Not sure what the workflow could be on that end. Maybe just submitting profiler data but that would be tricky for QA to do much with.

3 Likes

This would be extremely nice to have.

I heard rumors about Unity is targetting a state change time for entering play mode below 1sec for the 2019.3 tech branch…

2 Likes

Thanks Alkis! You should be able to see some activity in your thread soon.

2 Likes

Can i please cross-reference this thread which has some other people’s findings related to this topic: Unity assembly definition files slower, not faster - how to compile faster?

1 Like

Could you please let me know in what Unity version the fix landed? The original bug-report is closed and the public issue tracker item is marked as “fixed in 2019.3”:
https://issuetracker.unity3d.com/issues/2019-dot-3-and-2019-dot-1-streams-are-significantly-slower-when-entering-the-play-mode

What beta should I use to re-test the fix?

2 Likes

As I can see in the system the fix version is 2019.3.0a12 and backport is 2019.2.7f2.

PS: According to our perf tests data enter playmode on empty projects on i7-4930K (Windows) takes

  • 2020.1a13 - 1.7 seconds.
  • 2019.3b12 - N/A.
  • 2019.12f1 - 1.5 seconds.
1 Like

Thanks for the quick reply. I’m going to take a look at it with b12, once released though, and report the results here. Can hardly wait to see how it improved! :slight_smile:

1 Like

There was a typo in @alexeyzakharov 's reply. The fix didn’t land in b12, it landed months ago in a12.

2 Likes

UI BUG DESCRIPTION
Unity 2019.2.12f1 always take 5sec to start in Play mode.

Environment
Hardware Device: i7 2600k, GPU GTX 1080Ti, 24Gb Ram,
Hardware Device: i5 9600k, GPU GTX 1080Ti, 32Gb Ram,
OS: Windows 10 64bit ()

Severity
Customer Impact: normal bug (always)

Note
4 min per day per user. If 100.000 users press 50 times Play button per day per 5sec = 25.000.000 sec = 290 days or one year of human life lost waiting for Unity to start per day.

@LeonhardP Hello World: As an example to understand how long

2 Likes

Yes, yes, exactly! That’s why we are proposing to switch to enter Play Mode without domain reload - this significantly reduces time to start Play.

This is what we are trying to fix starting from 2019.3. I’ve got very similar similar numbers mentioned in the alpha doc for 2019.3 “configurable Play Mode” feature :slight_smile: (Also: https://forum.unity.com/threads/configurable-enter-play-mode.768689)

1 Like

I’ve just tested 2019.3.0b11 and it’s not fixed in my opinion. Entering PlayMode in an empty scene with b11 takes 4s vs 2s in Unity 4.6, so it’s still twice as slow.

Profiler 5179760--514271--upload_2019-11-15_19-40-35.png

PS: As I wrote earlier, please use hardware similar to the one I submitted the bug-report with. You most likely can’t reproduce this on higher end machines.

2 Likes

Hi Peter. Many thanks for your sterling efforts in profilng and documenting the decline in editor performance over time. This is very valuable imho. Have you had a chance to try out the newer “enter playmode without domain reload” functions yet? Do these offer any improvement in your view? Thanks!

2 Likes