From 5ad72836596ed64897422b015fc4eccf8c3a4fca Mon Sep 17 00:00:00 2001 From: Antony David Date: Fri, 18 Oct 2024 14:36:46 +0200 Subject: [PATCH] build: rework opts --- Cargo.toml | 17 +++++++++++++++-- rust-toolchain.toml | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 22c9f9d..8c8ada2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,11 +23,24 @@ name = "sudoku_rust" path = "src/main.rs" [profile.release] -lto = true +# Configurations explicitly listed here for clarity. +# Using the best options for performance. opt-level = 3 +lto = "fat" +codegen-units = 1 +strip = "symbols" # Set to `false` for debug information +debug = false # Set to `true` for debug information +panic = "abort" # Let it crash and force ourselves to write safe Rust + +[profile.release-with-debug] +inherits = "release" +strip = false # Keep debug information in binary +debug = true # Include maximum amount of debug information [profile.dev] -opt-level = "s" +# Disabling debug info speeds up local and CI builds, +# and we don't rely on it for debugging that much. +debug = false [[bench]] name = "sudoku_benchmarks" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 83e9db1..749f19c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,4 +2,4 @@ # The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy. # https://rust-lang.github.io/rustup/concepts/profiles.html profile = "default" -channel = "1.81" +channel = "1.82"