godot icon indicating copy to clipboard operation
godot copied to clipboard

Editor takes a long time to load project with large amount of media files

Open sanlor opened this issue 1 year ago • 11 comments

Tested versions

v4.2.2.stable.official [15073afe3]

System information

Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Mobile) - dedicated NVIDIA GeForce MX230 (NVIDIA; 31.0.15.3209) - Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 Threads)

Issue description

When opening an existing project with a lot of sprites, sound effects and music, the editor takes some time to open. It usually opens an empty project then it opens the actual project. It doesn't seems to matter the size or type of the media file. If you have a lot of them, it is going to be slow.

Using the MRP, the delay is noticeable with 22000 image files.

Steps to reproduce

  • Open the MRP.
  • Take note of the time it took to open
  • Run the project and generate 22000 images.
  • Stop the project and wait for the files to be imported.
  • Reopen the MRP
  • Take note of the time it took to open

Minimal reproduction project (MRP)

Uploading delay.zip…

sanlor avatar Jul 29 '24 13:07 sanlor

the delay is noticeable with 22000 image files.

That is an enormous number of images for any project IMO

Also you didn't upload the MRP properly, please try again and don't click away until it's finished uploading

AThousandShips avatar Jul 29 '24 13:07 AThousandShips

I'm sorry, but for some reason I'm having a hard time uploading the MRP. I uploaded it to Filebin for the time being: https://filebin.net/uwqretaceha2xwxm

the delay is noticeable with 22000 image files.

That is an enormous number of images for any project IMO

I agree. I'm porting a RPG to Godot, with a lot of assets. I tried importing all of them and I had to wait about 5 minutes for it to open. I mean, waiting isn't all that bad, but the lack of a loading message had me questioning if the project was corrupted or not.

I had this problem with other projects, with few media files but a lot of scripts, custom resources, classes and scenes. I'm opening the issue since i'm not sure if this behavior is expected or not.

sanlor avatar Jul 29 '24 14:07 sanlor

Five minutes to import or for it to respond? There might be some interface issues to make it more responsive but processing that many files is always going to be slow

Can you try with rc1 there's been some improvement to some of the workflow

But your message makes it a bit more clear what you are asking, the original issue didn't make it clear that the issue was more the responsiveness of the editor, importing 22 thousand files is always going to be slow, no matter how efficient we make it (even if a file takes just a few milliseconds to load it still takes several minutes)

AThousandShips avatar Jul 29 '24 14:07 AThousandShips

Five minutes to import or for it to respond? There might be some interface issues to make it more responsive but processing that many files is always going to be slow

About 5 minutes for the editor to respond. Importing the files also takes a long time, but that is expected. The issue is when the files are already imported, you close and reopen the project. When the project opens, it looks empty, without any message or loading bars. After some time, the actual project opens.

Please note that the 22000 images files is just an example to simulate the behavior observed. A project can have 1000 sound files, 2000 textures / sprites and this behavior will probably occur.

I will check the MRP using the rc1 and see if there are any changes on the performance.

sanlor avatar Jul 29 '24 16:07 sanlor

I will check the MRP using the rc1 and see if there are any changes on the performance.

It seems that it still takes a while to load using the rc1, but now its possible to see a loading screen (which is a big improvement!)

image

took 67959 msecs to start.
There are 20001 files.

sanlor avatar Jul 29 '24 17:07 sanlor

  • Related to https://github.com/godotengine/godot/issues/47053.

Can you test https://github.com/godotengine/godot/pull/93064 locally? It should improve project loading speeds in projects with lots of files. (Note that CI-provided builds are not fully optimized, so official binaries featuring would be faster.)

Calinou avatar Jul 30 '24 06:07 Calinou

Can you test #93064 locally? It should improve project loading speeds in projects with lots of files. (Note that CI-provided builds are not fully optimized, so official binaries featuring would be faster.)

Thanks, I will give it a try later.

Just a quick update, I tried the MRP on a more powerful device and the loading time is still noticeable, but a lot faster. Both PCs are using SSDs.

Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Mobile) - dedicated Radeon (TM) RX 480 Graphics (Advanced Micro Devices, Inc.; 31.0.12042.4) - AMD Ryzen 7 5700G with Radeon Graphics (16 Threads)

took 40589 msecs to start. There are 44001 files.

sanlor avatar Jul 31 '24 11:07 sanlor

https://github.com/godotengine/godot/issues/47053#issuecomment-2143560862

Try setting a windows defender exception for the project folder, it made a huge difference for me

Jordyfel avatar Jul 31 '24 11:07 Jordyfel

So, I was able to compile the #93064 , both on Windows and Linux (running under WSL on the same PC):

On Windows was still very slow, but on Linux was surprisingly fast on 4.2, 4.3 RC1 and the custom build. Not sure why. Windows Defender was disabled for all tests below.

Godot v4.3.rc (6eddde16f) - Windows 10.0.22631 - Vulkan (Mobile) - dedicated NVIDIA GeForce MX230 (NVIDIA; 31.0.15.3209) - Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 Threads) v4.3.rc.custom_build [6eddde16f]

took 57445 msecs to start.
There are 24000 files.

Godot v4.3.rc (6eddde16f) - Kali GNU/Linux Rolling 2024.2 - Vulkan (Mobile) - (software emulation on CPU) llvmpipe (LLVM 17.0.6, 256 bits) - Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 Threads) v4.3.rc.custom_build [6eddde16f]

took 16782 msecs to start.
There are 24000 files.

Godot v4.3.rc1 - Kali GNU/Linux Rolling 2024.2 - Vulkan (Mobile) - (software emulation on CPU) llvmpipe (LLVM 17.0.6, 256 bits) - Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 Threads) v4.3.rc1.official [e343dbbcc]

took 20992 msecs to start.
There are 22001 files.

Godot v4.2.2.stable - Kali GNU/Linux Rolling 2024.2 - Vulkan (Mobile) - (software emulation on CPU) llvmpipe (LLVM 17.0.6, 256 bits) - Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 Threads) v4.2.2.stable.official [15073afe3]

took 17557 msecs to start.
There are 22001 files.

sanlor avatar Jul 31 '24 17:07 sanlor

. Not sure why. Windows Defender was disabled for all tests below.

You checked on task manage to see if there was something that was running on windows that bottleneck your loading times?

Godot v4.3.rc1 - Kali GNU/Linux Rolling 2024.2 - Vulkan (Mobile)

 took 20992 msecs to start.
> There are 22001 files.

Godot v4.2.2.stable - Kali GNU/Linux Rolling 2024.2 - Vulkan (Mobile)

took 17557 msecs to start.
There are 22001 files.

Interesting though why the custom build has more files in it that the other and it weird there was not much substantial improvement aside from better feedback on loading. The most surprising is why is 4.3 rc 1 slower than 4.2.2 stable in linux, might be the scanning stuff or something else? You can check it too on windows if it happens the same?

Saul2022 avatar Aug 16 '24 15:08 Saul2022

@sanlor can you try with your project with a build from this PR: https://github.com/godotengine/godot/pull/95678

Hilderin avatar Aug 17 '24 02:08 Hilderin