Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ The workspace ships with an aggressive release profile (`Cargo.toml`):

```toml
[profile.release]
lto = true # Full link-time optimization
lto = "thin" # Thin link-time optimization
codegen-units = 1 # Maximum optimization (slower compile)
panic = "abort" # No unwinding - smaller binary, but panics terminate immediately
strip = true # Strip debug symbols
```

- **`panic = "abort"` means panics kill the process instantly** - reinforcing why `unwrap`/`expect` are banned in library code.
- Always validate performance claims in `--release` mode. Debug builds are not representative.
- Be aware that LTO + single codegen unit makes release builds slow. Use `cargo test` (debug) for iteration, `cargo build --release` for final validation.
- Thin LTO with a single codegen unit keeps cross-crate optimization while reducing release build time compared with full LTO. Use `cargo test` (debug) for iteration, `cargo build --release` for final validation.

---

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ unnecessary_box_returns = "deny"
unsafe_code = "deny"

[profile.release]
lto = true
lto = "thin"
codegen-units = 1
panic = "abort"
strip = true
Expand Down
6 changes: 3 additions & 3 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,12 @@ impl Step {
run: || {
// Use the dev profile (not the default bench profile) for the
// criterion `--test` smoke run. The bench profile inherits the
// release profile's `lto = true, codegen-units = 1`, which spends
// ~40s compiling the full graph just to assert criterion's
// release profile's `lto = "thin", codegen-units = 1`, which still
// compiles the full optimized graph just to assert criterion's
// `--test` entry point runs once. The dev profile reuses the
// already-built unit-test artifacts and finishes in seconds. Real
// benchmark measurements (via `cargo xtask bench`) continue to
// use the unchanged bench profile so their numbers stay accurate.
// use the release-derived bench profile so their numbers stay accurate.
run_command_quiet(
"cargo",
&[
Expand Down
Loading