Jump to content

[2.15.1] Improve startup speed of release build


photo

Recommended Posts

Posted

Hi all,

we are currently in the stage of shipping of one of our products to a client. We have an WPF-application with Unigine Engine version 2.15.1, therefor we need to release it via Visual studio. What we have noticed during some internal tests is, that the main application takes up to two minutes to start. We only have few assets shipped with the product, mainly small icons made in 3D and FBX (but set them up as NodeReferences in the editor). The main bottleneck seems to be "Runtimes loaded" and "Filesystem initialization".

Second, the user is able to create new working projects within our application. To get it done, we create with each new project a new folder (external from application folder) and add them as an mount point. In this new folder, the user will create new meshes and fbx files. That works fine in production, however, adding those mount points will increase startup time for the next application startup (my guess is that UNIGINE scan those mount points for internal optimization during runtime). "Runtimes loaded" and "Filesystem initialization" time increase with each project.

My question is, if there is an simple way to improve the loading time? One simple workaround for us is simply removing all external mount points before engine startup in WPF and when the user loads an existing project, the mount point will be added again.

 

Best regards

Christian

Posted

Hi Christian,

Could you please send me logs of engine start-up times? 2.15 indeed can be quite slow to start due to materials loading option, the more you have the longer it will parse them on start-up.

There is a console command and parameter in .boot config that may skip some materials preloading on startup, improving start-up times, but it may produce spikes and hiccups later during the application work:

  • materials_loading_mode 0 - minimal caching (fastest)
  • materials_loading_mode 1 - full caching enabled
  • materials_loading_mode 2 - full caching enabled + shaders compiled (slowest)

We did a lot of filesystem improvements in the latest 2.19-2.20 releases and now engine starts up 5-10 times faster than 2.15.x and older versions.

Sometimes slowdown is caused by Windows Defender and it helps to add the folders which are required for project to work to exclude list: https://developer.unigine.com/en/docs/2.15.1/troubleshooting/antivirus/#exclusion

At the end the best solution maybe that you already mentioned - mount folders after loading :)

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

Hi silent,

thanks for the reply. I attached the latest log-file from our internal build. I cleared any mount-point before, so only the root-mount is enabled by default. Even in that scenario, Runtimes are loaded within 13 seconds and Filesystem initialization takes 22 seconds, compared to only 3 seconds for the materials. All errors with the Object:setMaterialsGUID() are related to loading an existing world by mount a new folder before loading the world (so this does not happen during startup).

We will see, if we can later update our application to a newer version, but for now we (unfortunately) have to stay at 2.15.1. And because of we create a new mount point when the user of our app creates a new project, it will be hard to exclude the folder to the Windows Defender by default. But maybe it is a good idea to add a note to our app documentation, in case re-loading a project is needed.

Thanks

Christian

 

log.txt

Posted

Do you have such long start-up times only on that laptop? It's quite unusual for 300 files to take up 22s to load, there might be something else involved, but it's hard to tell without additional profiling.

In Visual Studio you can do a CPU profiling to get an idea where all the CPU time was spent on during the startup: https://learn.microsoft.com/en-us/visualstudio/profiling/cpu-usage?view=visualstudio

Maybe that will shed some light on the loading times.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

×
×
  • Create New...