From b7583f4db074e32687a2fdba63303010774201a2 Mon Sep 17 00:00:00 2001 From: Ian Wijma Date: Tue, 21 Nov 2023 00:08:17 +1100 Subject: [PATCH] Update Cargo.toml for optimized release binary Configured the `Cargo.toml` to automatically strip symbols, optimize for size, enable Link Time Optimization (LTO), and set codegen-units to 1 for the release profile. This significantly reduces the size and improves the performance of the resulting binary. --- Cargo.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 48e9183..f3d9f4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,10 @@ edition = "2021" [dependencies] clap = { version = "4.4.8", features = ["derive", "unicode", "wrap_help"] } + +[profile.release] +strip = true # Automatically strip symbols from the binary. +opt-level = "z" # Optimize for size. +lto = true +codegen-units = 1 +