Godot, system load optimization

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By VarionDrakon

Good time of day. Friends, such a question of “optimization” (Yes, it sounds funny) is there a load on the system, from a disabled (Hidden, disabled, whatever) node?

:bust_in_silhouette: Reply From: Calinou

Hiding a node will generally improve performance, but only to a certain extent. Most importantly, hiding a node will not prevent its _process() and _physics_process() functions from running. If you want to prevent that, check whether the node is visible using is_visible_in_tree() before running tasks that are only useful when the node is visible. (Note that this check has a cost, so only do it if the node has a high likelihood to be hidden.)