Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow import with a ton of small files. #95979

Open
Saul2022 opened this issue Aug 23, 2024 · 1 comment
Open

Slow import with a ton of small files. #95979

Saul2022 opened this issue Aug 23, 2024 · 1 comment

Comments

@Saul2022
Copy link

Saul2022 commented Aug 23, 2024

Tested versions

Reproducible in 4.3 stable, 4.4 #93064

System information

Sansung galaxy s23+ Forward mobile

Issue description

This issue might seem related to #93877 , but not, because the import is alr using vsync dissabled and update continously, so it not that , and also is not the speed itself because importing each files is instant( due to the minimal size in project.

Anyways , to start with, in a project where you have to import tons of tons of images like over 100k small image files it quite slow, as sure mobile is alrays slower, but taking 2 HOURS to get the import to 50% , is kind of suspicious, as the impprt of each files is instant as most just have small kbs on memory, they are easy to import, and mipmap or compression do not look like they aggregate time( as it still total instant again, they don't even take 1 second to import one) , so the cause must be on something else( also note this can be reproducible on model files tho).

The possible cause:

An idea i had on what is causing the slow import might be that is just processing 1 file after another then repeat, when it has the chance to procced way more at the same time as i said due to importing each being really fast. Another cause might just be the lack of having the import process in parallel, but i am not aware if it there in this side or not..

Ways to solve it?

  1. Make the reimport process instead of reading one file at a time, make it proceed like 10 or 20 at the same time as a list and then repeat with other 10 and etc..For it we can use the info we recieved from the mport preparation to classify the files by 10 or 20 as i mentioned.
  2. Make the import process to use threads if not done ( idk if it done alr), ie divide the process by the number of threads and each file reimported has it own thread, or even combine it with what i mentioned of processing 10 files at the same time without being blocked on just processing 1 by 1 file.(Edit, it seems it multithreaded alr based on some stuff i heard)

Steps to reproduce

  • Open the project

  • Wait for everything is scanned until reimport assets popup.

  • Notices how the files reading instantly, are still quite slow to import everythimg

Edit notes: you can also reproduce this easily just by duplicating small files a lot of times, i kind of reproduced it a bit on tps demo by duplicating the models folder multiple times until gettting to 15 gb, but it takes 50 minutes to reimport as it more like over 25k files( though combined with .godot folder it like almost 40 gbs 😅), which further confirms it not the size, but the amount of size on the texture were 1k, 2k and 4k.

Minimal reproduction project (MRP)

It pretty big so i rediret to it page https://github.com/PMDCollab/SpriteCollab/tree/master

@Saul2022
Copy link
Author

Saul2022 commented Aug 28, 2024

Update: For the purpose of clarification i made a way smaller mrp to see what is affecting the stuff here, and weirdly though there's no mipmaps nor compression being applied , though a lot of these files are rgba8 , so maybe it could have something to do( does they convert to rgba from rgb? ). Also some files freeze the engine or take more seconds (though almost all of them load instantly)?

Aside from that i also noticed when clickin on folder it all is freezing( prob , because it's updating action, but clicking it from left tab when you are on the bottom file system it instant.

load.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants