Merge pull request #190 from Manubi/patch-1
This commit is contained in:
@@ -69,12 +69,18 @@ You may be wondering—what is a profile setting? Let's get into that!
|
|||||||
A [**profile**](https://doc.rust-lang.org/cargo/reference/profiles.html) is a set of configuration options that can be
|
A [**profile**](https://doc.rust-lang.org/cargo/reference/profiles.html) is a set of configuration options that can be
|
||||||
used to customize the way Rust code is compiled.
|
used to customize the way Rust code is compiled.
|
||||||
|
|
||||||
Cargo provides two built-in profiles: `dev` and `release`.\
|
Cargo provides 4 built-in profiles: `dev`, `release`, `test`, and `bench`.\
|
||||||
The `dev` profile is used every time you run `cargo build`, `cargo run` or `cargo test`. It's aimed at local
|
The `dev` profile is used every time you run `cargo build`, `cargo run` or `cargo test`. It's aimed at local
|
||||||
development,
|
development,
|
||||||
therefore it sacrifices runtime performance in favor of faster compilation times and a better debugging experience.\
|
therefore it sacrifices runtime performance in favor of faster compilation times and a better debugging experience.\
|
||||||
The `release` profile, instead, is optimized for runtime performance but incurs longer compilation times. You need
|
The `release` profile, instead, is optimized for runtime performance but incurs longer compilation times. You need
|
||||||
to explicitly request via the `--release` flag—e.g. `cargo build --release` or `cargo run --release`.
|
to explicitly request via the `--release` flag—e.g. `cargo build --release` or `cargo run --release`.
|
||||||
|
The `test` profile is the default profile used by `cargo test`. The `test` profile inherits the settings form the `dev` profile.
|
||||||
|
The `bench` profile is the default profile used by `cargo bench`. The `bench` profile inherits from the `release` profile.
|
||||||
|
Use `dev` for iterative development and debugging, `release` for optimized production builds,\
|
||||||
|
`test` for correctness testing, and `bench` for performance benchmarking.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
> "Have you built your project in release mode?" is almost a meme in the Rust community.\
|
> "Have you built your project in release mode?" is almost a meme in the Rust community.\
|
||||||
> It refers to developers who are not familiar with Rust and complain about its performance on
|
> It refers to developers who are not familiar with Rust and complain about its performance on
|
||||||
|
|||||||
Reference in New Issue
Block a user