Repository navigation
Use a Thread for loading multiple paths in ImportDock - #124844
Draft
NoNormalDev wants to merge 1 commit into
Draft
NoNormalDev wants to merge 1 commit into
NoNormalDev wants to merge 1 commit into
Conversation
NoNormalDev
force-pushed
the
finally
branch
3 times, most recently
from
October 25, 2026 15:18
50a638e to
2339084
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem(s) does this PR solve?
Editor freeze when selecting a big folder / many files (of the same type) in the FileSystem dock.
Most (98%) of that time during the freeze is spent reading
.importfiles from the disk inImportDock::set_edit_multiple_files(), so the solution is to do that on a Thread.Overview
2026-10-24.19-50-58.mp4
2026-10-24.19-51-48.mp4
Changes
Moved the
ImportDockParamtersdefinition into the.hfile, while keeping the implementation in the.cpp.Replaced some includes with forward-declaration.
Created a new class -
ImportDockLoader. It's job is to read.importConfigFiles and gather information from it, basically the first half of the oldset_edit_multiple_paths(). The class usesWorkerThreadPoolto run the function asyncrhonously, but it also provides a way to run it on the current thread, which is used inset_edit_path().Joined the ends of
set_edit_multiple_paths()/set_edit_path()into_finish_set_edit(), to remove code duplication, and to fix some inconsistencies/bugs in the multiple paths scenario.When the
ImportDockLoaderis running, a progress bar is shown. To avoid flickers if the loader completes very quickly (most of the time), I added a minimum display timer, set to 0.2 seconds.Extended the
clear()function a bit.Some general cleanups.
Additional information
No AI was used.
For comparison, here's the profiler view (in red is marked the work that is now done on the thread, and blue is the little that remains on the main thread):

Mainly used https://store.godotengine.org/asset/voxy/at-icons/ for testing (contains many .svg files).
This is my biggest PR yet, so any feedback is welcome!