I’ve just started learning Rust as of yesterday, so I have a lot of basic questions and I hope this is the right place to ask them?
Going through the rust-lang book and talking about Cargo, I’m told the following:
When our project is finally ready for release, we can use cargo build --release to compile our project with optimizations.
My question is; if there is a flag for optimisation, why doesn’t Cargo do this by default? It feels like I’d always want my code to be optimised?
I thought about this for a while before asking (and searched the forum for an answer, but didn’t find one), and I thought that maybe if you have a larger program, the optimise process takes a longer amount of time so you don’t want to keep doing that when you’re developing?
It’d be great to have a concrete answer from those who know more about Rust.