Loading takes much more time on android than windows

same packaged games , it takes much more longer on android than on windows when open a new level, 9 seconds on android and only 2 seconds on windows(only about 1 second used after the second time opening level on windows). both packaged games use pak.I guess the diffrence between the two platform is the “platfrom file” related operation, if so, android platform should be faster. are there anything else should be checked or how could I optimize the loading progress ? thanks.

It might be shader compiling time for new material dependencies in the level; this is done by the driver and sometimes is very slow. Some devices have a per application shader cache to prevent the hit the second time, others don’t.

You can try using these console commands:

stat loadtime
stat loadtimeverbose
stat shadercompiling

Hi,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

Above: on windows
Below: on Android

I used the command loadtime, and it seems that time was mostly spent on file operation(loadmap, search).

and ‘stat loadtimeverbose’ didn’t show me anything.

It looks like it is likely using the IFileManager::Get().FindFilesRecursive() to find packages by short name. You can add some logging to SearchForPackageOnDisk in PackageName.cpp to verify this.

yeah, I fixed that using full path name, but the “loadmap” and other "serialize"s still cost too much time and it didn’t cost that much time in UE4.7

Do you have a comparison of the timings between 4.7 and 4.8.2 on Android? What kind of difference are you seeing?

no, I don’t have the comparision, I can’t go back after upgrade project to 4.8, I just feel waiting longer. I find that most time are spent by “LoadPackageInternal”(most are Blueprint or UMG) and what cost most in LoadPackageInternal is “ConstructObject” by profiling on android.

One thing you can do in 4.9 is to use Asset IDs in blueprints (TAssetPtr in C++ code) in order to defer loading of your assets and blueprints until you need them. There shouldn’t be any major differences in loading times on Android platforms between 4.7 and 4.8, but perhaps refocusing the content that you’re loading would help.

1 Like

it’s okay.