Skip to content

Conversation

ibrahn
Copy link
Contributor

@ibrahn ibrahn commented Oct 30, 2021

Copying the editor behaviour of deactivating these servers we're not
using, to reduce CPU load.

Partial fix for #54291

Copying the editor behaviour of deactivating these servers we're not
using, to reduce CPU load.
@Calinou
Copy link
Member

Calinou commented Oct 30, 2021

See also #38208.

Out of curiosity, why can't NavigationServer2D be disabled? I don't see a set_active() method for it, unlike NavigationServer3D.

@ibrahn
Copy link
Contributor Author

ibrahn commented Oct 30, 2021

Editor lines, just for easy reference:

godot/editor/editor_node.cpp

Lines 5782 to 5788 in 6b0b1a4

NavigationServer3D::get_singleton()->set_active(false); // no nav by default if editor
PhysicsServer3D::get_singleton()->set_active(false); // no physics by default if editor
PhysicsServer2D::get_singleton()->set_active(false); // no physics by default if editor
ScriptServer::set_scripting_enabled(false); // no scripting by default if editor

@ibrahn
Copy link
Contributor Author

ibrahn commented Oct 30, 2021

I wondered about the Nav2D server as well, but I couldn't find any cases where we deactivate that one, or how to do it, so it may be a more involved puzzle. Neither of the Nav servers seemed to be much of a factor in the CPU usage though so it might not be much of a priority here.

@akien-mga akien-mga merged commit bef20f5 into godotengine:master Nov 16, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 16, 2021
@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 18, 2021
@ibrahn ibrahn deleted the project-manager-nophys branch April 7, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants