From 42628a53b91f71ec47c0d9908435da6e44b0f11d Mon Sep 17 00:00:00 2001 From: Shahar Naveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Wed, 4 Mar 2026 09:59:59 +0100 Subject: [PATCH] Set `codegen-untis=1` for some crates in release mode (#7332) --- Cargo.toml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4813ab159..cc35b1241 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,10 +77,21 @@ opt-level = 3 # https://github.com/rust-lang/rust/issues/92869 # lto = "thin" -# Doesn't change often +# Some crates don't change as much but benefit more from +# more expensive optimization passes, so we selectively +# decrease codegen-units in some cases. [profile.release.package.rustpython-doc] codegen-units = 1 +[profile.release.package.rustpython-literal] +codegen-units = 1 + +[profile.release.package.rustpython-common] +codegen-units = 1 + +[profile.release.package.rustpython-wtf8] +codegen-units = 1 + [profile.bench] lto = "thin" codegen-units = 1