-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Use Hashset for dependency list when moving #83941
Conversation
Doubtful that this was missed, as the person who introduced the |
Updated description to the current state of the PR |
Not sure why is this labelled as bug. Does it fix anything? Looks like performance enhancement. |
Seemed like a bug from the original description, and was due to a mistake in previous update by OP, so it fixes reduced performance caused by a previous PR |
The reduced performance only takes effect when renaming or moving files and pretty sure it's only noticeable in very extreme cases. |
I'm not sure what to call an introduced performance drop though, feel free to assign a label you feel more appropriate :) |
Could you benchmark this and provide before-after results for comparison? (Ideally, upload a reproduction project as well if size permits it.) |
Some limited testing in a copy of my largest (not very large still) project showed no statistically meaningful difference. |
Thanks! |
Change the
save_scene_list()
function inEditorNode
to take aHashSet
for a fasterhas()
call on potentially large lists. Sometimes only one scene needs to be saved, so added a new function to do that without having to create a data structure.The
_find_file_owners()
function is executed every time on move or rename, scans the entire filesystem, and pushes paths of files which depend on moved or renamed files into a list.It seems to me that the list of depending files is a good candidate for a
HashSet
, since it's a (potentially large)String
list which is only iterated over and is likely to get unneeded duplicates.Also change the other parameter to
HashSet
, since I changed it to aVector
in #81657 which is a mistake.