mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Speed up GDScript::get_must_clear_dependencies()
get_must_clear_dependencies() has a N^3*log(N) time complexity, and this can very quickly slow down the quitting process as more gdscripts are added in a project.
This change improves it to N^2*log(N).
Instead of using all the inverted dependencies, we do the same with all (non-inverted) dependencies, which is N times faster.
Fixes #85435
(cherry picked from commit 0d77c3e092)
This commit is contained in:
@@ -253,7 +253,7 @@ public:
|
||||
const Ref<GDScriptNativeClass> &get_native() const { return native; }
|
||||
|
||||
RBSet<GDScript *> get_dependencies();
|
||||
RBSet<GDScript *> get_inverted_dependencies();
|
||||
HashMap<GDScript *, RBSet<GDScript *>> get_all_dependencies();
|
||||
RBSet<GDScript *> get_must_clear_dependencies();
|
||||
|
||||
virtual bool has_script_signal(const StringName &p_signal) const override;
|
||||
|
||||
Reference in New Issue
Block a user