From b570289d2cd07ea1a0cda0b6740843ebfaa01877 Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Mon, 31 Mar 2025 18:03:28 +0200 Subject: [PATCH] Clean up and improve release profile flags --- Cargo.lock | 12 ++++++------ Cargo.toml | 18 +++++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e0a937..b833ed6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,18 +76,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.32" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" dependencies = [ "anstyle", "clap_lex", @@ -262,9 +262,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "oorandom" diff --git a/Cargo.toml b/Cargo.toml index 139a1f7..9cdd63b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,16 +7,20 @@ edition = "2024" debug-layout = [] debug-latency = [] +# `opt-level = "s"` may be useful in the future as it significantly reduces binary size. +# The primary problem are the ucd and utf8 modules which take a 20% performance hit. [profile.release] -codegen-units = 1 -debug = "full" -lto = true -panic = "abort" -debug-assertions = true # Temporary while I test this +codegen-units = 1 # reduces binary size by ~2% +debug = "full" # No one needs an undebuggable release binary +debug-assertions = true # TODO: Temporary while I test this +lto = true # reduces binary size by ~14% +panic = "abort" # reduces binary size by ~50% in combination with -Zbuild-std-features=panic_immediate_abort +split-debuginfo = "packed" # generates a seperate *.dwp/*.dSYM so the binary can get stripped +strip = "symbols" # See split-debuginfo - allows us to drop the size by ~65% [profile.bench] -codegen-units = 16 -lto = "thin" +codegen-units = 16 # Make compiling criterion faster (16 is the default, but profile.release sets it to 1) +lto = "thin" # Similarly, speed up linking by a ton [dependencies]