+1
Fixed

Hang when entering playmode

Lazlo Bonin (Lead Developer) 3 years ago updated 3 years ago 13

There have been some reports of an abnormally long hang when entering playmode, sometimes close to a minute of waiting time. I've been able to reproduce the issue somewhat and I am investigating potential fixes.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

Awesome that you spotted something. I noticed you took down instructions. Don't need data anymore? Because I attempted it, and it crashed with this

:


+1

I took down the instructions because of this, haha!

Unity cannot load the profiling data for deep profile + enter play mode, it crashes due to memory allocation (the data file is > 4 GB). So I'll have to do it myself manually.

Lucky find: I think I spotted a major cause of lag, and (fingers crossed, knock on wood), it should be an easy fix.

Awesome! I’ll grab the update and see if there are any changes just in case.

Here are some findings on my machine. My benchmark is a simple rotating cube, from the instant I press the play button to when the graph window is fully displayed with smooth animations.

  • There is about 20% of the load time that is core to Unity loading time and unavoidable.
  • With optimizations, I was able to take away 25% seconds of the load time.
  • Loading the Unity documentation takes about 33% of the load time.
  • There is therefore a remaining 22% of Bolt load time



Meaning in the next version, this pie will look like:


Of course, disabling built-in documentation would speed things up by a lot, but it's taking away a major feature. I'm not sure how to optimize it further, because the bottleneck is just XML loading of a huge documentation file, over which I have no control.

I want to keep optimizing the yellow part of that pie as much as I can, maybe up to half of its current size.

Is this something we are doing to get it that long though? On some machines people reporting 1-2 seconds, some 7, but me 1 plus minutes. Something has to be wrong on my part. I have a very large project I've been working on for a year now, but some of the heavy instantiating isn't even happening at start. I have my own load screen. The biggest one is just a level manager that is on awake. When it was purely code, it worked instantly. Even after your first 1.0;4 bigger optimization, I saw huge increases. Then all the sudden I didn't. I always thought my keyboard was the problem. Its the longest to instantiate, and is around the time I saw these increases sky rocket. Every letter has 2 flow machines for it's button effect and selection action. They are all macros. I'd assume referencing the same macros would be better on the system. I didn't see problems when it was done in script. Now it's pretty slow.

Should I really be doing this in some sort of manager on the keyboard over it's effects, and what is selected? Perhaps it is just too much for the system? Or is this really just optimization issues at its core?

I just feel it seems weird this is so off balance with everyone seeming to have decent computers, who is reporting.

I'm sorry you're having such long load times. The green part you saw will be optimized away in 1.1.3 (should be released around next week). And further in the yellow slice too. I may add an option to disable built-in documentation and speed up the load process. 

Did your load time decrease with the 1.1.2 update (released today) help in your big scenes? 

Sounds great though! 

By runtime instantiation a little yes, ,playmode hang is roughly the same. I just did a test. I deleted my keyboard prefab after backing it up. Playmode hang is now 25 seconds. Added it back in, and I got 1 minutes 3 seconds. Wow, that is a huge change for 1 prefab.

Let's continue this issue in private to stay on topic here (please send a private ticket with your keyboard prefab if possible).

Lazlo, what is the possibility you could disable the  loading/instanciating of documention only when entering play mode.  Then re-enable on exit.  That may hepl. I for one would prefer a slightly longer losad time if necessary after rather than before if it only slows me from entering the graph again or am I not understanding the underlying issue well enough?

+2
Fixed in Alpha

Managed to get all the documentation loading (orange slice) on another thread, so it doesn't delay the load at all!

Also managed to cut down the remaining Bolt loading by 3x.

End results (on a bigger scene than the rotating cube):

  • Total Load: 5815ms 
  • Unity Load: 4426ms (76%)
  • Bolt Load: 1389ms (24%)

In other words: you can expect ~4x faster initialization on small scenes in version 1.1.3.