Skip to content
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

Low performance in debug mode #346

Open
WesterWest opened this issue Aug 25, 2020 · 6 comments
Open

Low performance in debug mode #346

WesterWest opened this issue Aug 25, 2020 · 6 comments

Comments

@WesterWest
Copy link

@WesterWest WesterWest commented Aug 25, 2020

I have recently discovered that bevy is quite laggy if debug is targeted even on a simple 3D scene. This is a issue that will greatly affect any larger projects quite soon and even the editor. There were some suggestions about enabling optimization even for debug, I think this should be included in start-up guide.

@CooCooCaCha
Copy link

@CooCooCaCha CooCooCaCha commented Aug 25, 2020

In my experience release mode is literally 10x faster than debug mode.

@memoryruins
Copy link
Contributor

@memoryruins memoryruins commented Aug 26, 2020

Although adding a crate override to increase opts for bevy nearly doubles the clean build times on my old thinkpad, the incremental/iterative builds have so far been similar (in addition to making performance with dev builds more bearable).

https://doc.rust-lang.org/cargo/reference/profiles.html#overrides

# Cargo.toml
[profile.dev.package.bevy]
opt-level = 1

If this is recommended in the guide, I suggest that there is a warning about increases in clean build times and a decrease in debugging quality (if debugging struggles, one should lower the opt-level back). That said, I think giving the option light, especially for the many new rust users diving in because of bevy, would be a good addition.

@Fishrock123
Copy link
Contributor

@Fishrock123 Fishrock123 commented Aug 26, 2020

Isn't this just a general Rust thing? Debug rust is slow as a rule. If you want it to be fast, compile in release mode.

@memoryruins
Copy link
Contributor

@memoryruins memoryruins commented Aug 26, 2020

If one only needs it to be as fast, the default --release profile generally achieves this, though the default is not always the most optimal settings for every project. Similarly, the default dev profile settings can be tweaked for bearable dev performance of realtime applications without forfeiting debug info and assertions that are disabled by --release by default. In addition, release builds tend to take a magnitude longer than dev builds. The idea is to offer tips that improve debug performance on machines that need it without sacrificing everything default --release does.

@aclysma
Copy link
Contributor

@aclysma aclysma commented Aug 29, 2020

Just a heads up, debug mode also turns on GPU validation for vulkan and possibly other platforms. +1 for adding something to the getting started guide

@cart
Copy link
Contributor

@cart cart commented Aug 30, 2020

Yup I also think this deserves to be called out in the getting started guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.