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.
In my experience release mode is literally 10x faster than debug mode.
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.
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.
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.
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
Yup I also think this deserves to be called out in the getting started guide.
Most helpful comment
If one only needs it to be as fast, the default
--releaseprofile 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--releaseby 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--releasedoes.