Profiles
Many cargo profiles are defined to optimize for different use cases.
Flowchart¶
As a general rule of thumb for what option to use, you can follow:
graph LR
Start((**Start**)) --> Release("`
Final Release?
<small>(Slow compilation)</small>
`")
Release --> |No| UseDevelop([_develop_])
Release --> |Yes| Flavor(Optimizing)
Flavor --> |Speed| Speed("`
Best size and speeds?
<small>(slower compilation)</small>
`")
Flavor --> |Size| Size("`
Smallest binary
<small>(slower compilation)</small>
`")
Speed --> |No| UseFast([_fast_])
Speed --> |Yes| UseFastest([_fastest_])
Size --> |No| UseSmall([_small_])
Size --> |Yes| UseSmallest([_smallest_])
Options¶
develop¶
Fastest build times, ideal for iterative development.
- 🟢 Strengths
- Iterative development
- Fastest build times
- 🔴 Trade-offs
- Larger binary size
- Slower runtime
fast¶
fastest¶
Same as fast, but with Fat LTO enabled.
- 🟢 Strengths
- Slightly smaller binaries
- Slightly faster binaries
- 🔴 Trade-offs
- Slower build times
small¶
smallest¶
Same as small, but with Fat LTO enabled.