Skip to content

Use WinitSettings::desktop_app in editor template to reduce CPU usage#258

Open
theotherphil wants to merge 3 commits into
jbuehler23:mainfrom
theotherphil:desktop_app
Open

Use WinitSettings::desktop_app in editor template to reduce CPU usage#258
theotherphil wants to merge 3 commits into
jbuehler23:mainfrom
theotherphil:desktop_app

Conversation

@theotherphil

@theotherphil theotherphil commented May 21, 2026

Copy link
Copy Markdown
Contributor

Editor CPU usage is currently extremely high on MacOS - pinned at ~100% of a CPU code whether the window is focused or not.

Update the editor template to use WinitSettings::desktop_app as recommended on bevyengine/bevy#10261.

Testing: ran it on my MacBook.... that's it!

.add_plugins(EditorPlugins::default())
.add_plugins({{crate_name}}::MyGamePlugin);
.add_plugins({{crate_name}}::MyGamePlugin)
.insert_resource(WinitSettings::desktop_app());

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you will likely need to add this to all templates - dylibs, extensions, etc

@ThierryBerger ThierryBerger May 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't you want to add this to the editor itself ? rather than templates ?

(I'm ok with adding it to templates but I feel it would benefit more in the editor itself ?

oh that is the template for a standalone editor for a project 🤯 👍

Actually, if the editor embeds the main game, would it be a risk to have stutter when "play in editor" mode ? it would need to switch mode ?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i think this be baked into the editor itself i think

@jbuehler23 jbuehler23 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janhohenheim do you think we should add this into the editor plugins?

@theotherphil theotherphil changed the title Use WinitSettings::desktok_app in editor template to reduce CPU usage Use WinitSettings::desktop_app in editor template to reduce CPU usage May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants