Godot version:
9f82368d40f1948de708804645374ea02ca6e7db
OS/device including version:
Linux
Issue description:
My project contains a lot of assets. When using the built-in script editor and typing load(" the editor will hang while it tries to populate the drop down for auto-completion.
Steps to reproduce:
load("You can disable the resource completion in the editor settings.
@vnen that works as a work around but I think this issue should remain open. The editor should internally prevent itself from searching too large of a search space and should not hang if the user hasn't turned off this option and has too many files.
@rminderhoud Does this still happen after the initial hang or just the first time?
I'm trying to understand the problem and trying to repro the issue at the moment.
There's a specific part in the editor file system that's taking a long time when there's a large amount of files. At the moment, I'm seeing the issue happen when there are new files introduced and are being added into the cache (I'm not sure what's happening at this point yet)?
There was also a slight hiccup during the resource_completion the first time the files were introduced.
I'm not seeing the load(" loading problem. The gdscript editor is still responsive as ever.
However, when I create a new gdscript. It does hang for a very long time.
From what I'm observing, it looks like creating a new script will trigger an event where the message queue gets read for each file you own.
The message queue per file will take at least 12 seconds to print out the stats. I'm not sure why the message queue is filled up, but it looks like it scales up with the amount of files you own.
so... 10k files * 12 seconds (this probably varies depending on the amount of files you own) is the amount of time the engine will take to create a new script.
The behavior mentioned on the original post might have happened when the asset re-import got triggered? I'm not sure. May be someone with more expertise on this can chime in...
Edit:
The things I mentioned above does not happen if you don't have invalid files. Otherwise, the invalid files will create slow-downs/hang-time to your editor.
@Chibin I'm not active on that project anymore but I don't recall doing anything particularly special with the data files. I believe I had maybe 5,000+ assets in a combination of mesh and texture files with a few sound files (mostly texture). The files were just added to the project and were not part of any scenes. This would occur after the initial import and I wasn't actively re-importing. Yes, thinking back to it there was a large number of files there that had import failures.
I actually encountered similar issue with recently added autocompletion for change_scene. Why is it a junior job? What would be "easy" fix?
Most helpful comment
@vnen that works as a work around but I think this issue should remain open. The editor should internally prevent itself from searching too large of a search space and should not hang if the user hasn't turned off this option and has too many files.