Jump to content
 
ben-FLOAT

Improve iteration time in editor

Recommended Posts

We've been looking to improve our iteration times, and while profiling found VIU causing a large slowdown. We are using Unity 2018.4.0 and VIU 1.10.4.

The main cause seems to be searching the file system in SymbolRequirement.Validate(). Attached is a screenshot of a deep profile. Without deep profile, the delay is about 9500 ms.

More info: Simulator is only device enabled in VIU Settings. The scene has one moving cube in it. The PC has SSD hard drives. The spike shown here happens a frame or two after the startup.

Ideally, SymbolRequirement.Validate() would not be done at all when playing in editor (perhaps only on changing VIU settings or build settings?)

VIU_editor_deep_profile.PNG

Share this post


Link to post
Share on other sites

I tried  a quick hack in DoUpdateScriptingDefineSymbols() :

if (Application.isPlaying) return;

which fixes the spike, however the spike occurs when stopping play mode as well. Would be great to have an official fix so symbols aren't validated due to any playmode activity.

 

@chengnay @Dario

Share this post


Link to post
Share on other sites

@ben-FLOAT Do you mind updating your VIU to latest version and check again if the issue still occurs?

In your project, you only import VIU and run under VIU's simulator mode?

What else I need to take note to reproduce the issue?

Share this post


Link to post
Share on other sites

I've confirmed this occurs on the latest 1.10.6 with a project having a substantial number of folders on disk. Our project has 20000+ files and 2000+ folders.

I setup a new project, imported VIU 1.10.6, latest SteamVR and Oculus. Play in editor was responsive. After generating 10000 txt files, there was a small lag, but not a big problem.

However, after generating 1000 folders running "For /L %i in (1,1,500) do mkdir folder_%i" a few times, a 4.5 second lag occurs a few moments after the scene becomes active. See the attached screenshot.

I've uploaded the test project here: https://drive.google.com/file/d/1SuFDpR-L6_6kbS11GbyYLbikZvaGJUMe/view?usp=sharing

viu_editor_folderslowdown.PNG

Share this post


Link to post
Share on other sites

Any scene should have this behavior, as it is due to the number of folders in Assets/, but I believe I was testing with SampleScene. Even a new empty scene should show the issue.

 

@chengnay

Share this post


Link to post
Share on other sites

Any thoughts on this? This problem looks like it would affect all medium and larger size projects. @chengnay @Dario

For now I am disabling Validate() on my machine until I need to switch platforms, but that's a hack. Perhaps a workable fix would be to run the full file scan whenever Unity starts up, but then uses https://docs.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher?view=netframework-4.8 to watch for changes in *.cs files and if so, triggering Validate(). This would fix iteration time for designers at least, though programmers would still be slowed down...

Share this post


Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...