# Optimizing by default

**URL:** <https://internals.rust-lang.org/t/optimizing-by-default/1532>\
**Category:** internals\
**Created:** [February 4, 2015, 12:41am UTC](https://internals.rust-lang.org/t/optimizing-by-default/1532 "2015-02-04T00:41:05Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tanadeau](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/tanadeau/32/5419_2.png) [@tanadeau](https://internals.rust-lang.org/u/tanadeau)\
**Post date:** [February 4, 2015, 12:41am UTC](https://internals.rust-lang.org/t/optimizing-by-default/1532/1 "2015-02-04T00:41:05Z")

</div>

There has been some good discussion on (at least) two issues [https://github.com/rust-lang/rfcs/issues/777](https://github.com/rust-lang/rfcs/issues/777) and [https://github.com/rust-lang/cargo/issues/784](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., `-O0` or `--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 `-O`".

---

_[View the full topic](https://internals.rust-lang.org/t/optimizing-by-default/1532)._
