There has been some good discussion on (at least) two issues https://github.com/rust-lang/rfcs/issues/777 and https://github.com/rust-lang/cargo/issues/784 regarding whether or not to do optimized builds by default, and if not, how to let new users know that
rustc my_file.rs or
cargo build doesn’t give fast code.
I was curious for the community’s thoughts on this. I would like optimization by default with explicit flags (e.g.,
--debug) to turn off optimizations. I think that would help to prevent “Rust is slow” first impressions that have also plagued other native languages including C++, Haskell, and Swift. Users coming from a Java, Python, etc. background may not even know that optimizations are a thing that they ever need to worry about.
If optimizing by default is controversial, I’d like to at least have rustc and Cargo print prominent warnings when no optimization flags are given.
As noted in the above issues, this has bitten newcomers with many issues on dev forums solved by "compile with