From 2325de357f85e9c71dba1e502854f5c4444f18f7 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Thu, 25 Apr 2024 19:06:53 +0100 Subject: [PATCH] feat: reduce executable size [profile.release] strip = true opt-level = "z" codegen-units = 1 lto = true # References # https://doc.rust-lang.org/stable/rustc/codegen-options/ # https://doc.rust-lang.org/rustc/profile-guided-optimization.html # https://github.com/johnthagen/min-sized-rust --- Cargo.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 6dab3d0..28ee824 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,3 +44,14 @@ pretty_assertions = "1.3.0" test-log = "0.2.11" env_logger = "0.10.0" trycmd = "0.14.16" + +[profile.release] +strip = true +opt-level = "z" +codegen-units = 1 +lto = true + +# References +# https://doc.rust-lang.org/stable/rustc/codegen-options/ +# https://doc.rust-lang.org/rustc/profile-guided-optimization.html +# https://github.com/johnthagen/min-sized-rust \ No newline at end of file