Description
Tested versions
Reproducible in: 4.4.beta [93d2706]
System information
OnePlus 8T, Android 14
Issue description
When loading patch PCKs on Android currently, it seems to take a long time to load the first patch when you have many files in the project, which upon investigation seems to stem from the changes made in #90425.
When profiling the MRP (consisting of 5000 barebones scene files) through Android Studio it would seem that it spends about 30 seconds (on my OnePlus 8T) in PackedSourceDirectory::try_open_pack
, which is what gets run (here) when you first load a non-main pack.
More specifically, it seems to spend a lot of time dealing with android::ZipAssetsProvider
when doing things like DirAccessJAndroid::dir_exists
as part of DirAccess::open
and DirAccessJAndroid::current_is_dir
as part of DirAccess::get_directories
.
Here's what the flame graph of the MRP's startup looks like:
Here's a bottom-up view:
Here's a zoomed in view of a few DirAccess::get_directories
calls:
Here's a zoomed in view of a few DirAccess::open
calls:
Steps to reproduce
I've included a patch PCK in the project, under patches/patch.pck
. All it does is change the label in main.tscn
to say "Patched" instead of "Not patched".
I've also included the script (generate.py
) used to generate the scene files under generated_scenes
.
- Open the MRP
- Deploy it on an Android device
- Note the time it takes before you're shown
main.tscn
Minimal reproduction project (MRP)
Metadata
Metadata
Assignees
Type
Projects
Status
Status