ben-FLOAT Posted November 5, 2019 Posted November 5, 2019 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?)
ben-FLOAT Posted November 5, 2019 Author Posted November 5, 2019 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
VIVE_chengnay Posted November 7, 2019 Posted November 7, 2019 @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?
ben-FLOAT Posted November 18, 2019 Author Posted November 18, 2019 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
VIVE_chengnay Posted November 18, 2019 Posted November 18, 2019 @ben-FLOAT Which scene should I play?
ben-FLOAT Posted November 23, 2019 Author Posted November 23, 2019 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
ben-FLOAT Posted December 7, 2019 Author Posted December 7, 2019 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...
sserfasm Posted November 27, 2022 Posted November 27, 2022 Unity gives you the option of disabling either Domain Reload, Scene Reload, or both. This can speed up entering and exiting Play mode. Just remember that if you plan on making further script changes, you need to re-enable Domain Reload. Similarly, if you modify the Scene Hierarchy, you should re-enable Scene Reload. You can doing different tasks with the help of quality video editor like alight motion mod apk .
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now