From cb297e1df58dfcef62b6cbf757410675cd176c75 Mon Sep 17 00:00:00 2001 From: Iban Eguia Date: Tue, 31 Mar 2020 12:23:02 +0200 Subject: [PATCH 1/2] Added more build profiles This will add build profiles for benchmarks and tests. It will also add a thin optimization layer to development builds, and make sure that benchmarks are run with the same build profiles as the release builds. --- Cargo.toml | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a0293216bbb..e376ab9ed90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,23 +6,44 @@ members = [ # The release profile, used for `cargo build`. [profile.dev] -incremental = true -opt-level = 0 +opt-level = 1 debug = true -rpath = false -lto = false debug-assertions = true overflow-checks = true +lto = false panic = 'unwind' +incremental = true +rpath = false # The release profile, used for `cargo build --release`. [profile.release] -incremental = false opt-level = 3 debug = false -rpath = false -codegen-units = 1 +debug-assertions = false +overflow-checks = false lto = true +panic = 'unwind' +incremental = false +codegen-units = 1 +rpath = false + +# The test profile, used for `cargo test`. +[profile.test] +opt-level = 1 +debug = true +debug-assertions = true +overflow-checks = true +lto = false +incremental = true +rpath = false + +# The benchmark profile, used for `cargo bench`. +[profile.bench] +opt-level = 3 +debug = false debug-assertions = false overflow-checks = false -panic = 'unwind' \ No newline at end of file +lto = true +incremental = false +codegen-units = 1 +rpath = false From e8a9ab2101d84cafa32793744f444fa550aa39ad Mon Sep 17 00:00:00 2001 From: razican Date: Tue, 31 Mar 2020 17:50:30 +0200 Subject: [PATCH 2/2] Remove redundant profile configurations --- Cargo.toml | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e376ab9ed90..347477474ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,44 +6,24 @@ members = [ # The release profile, used for `cargo build`. [profile.dev] +# Enables thin local LTO and some optimizations. opt-level = 1 -debug = true -debug-assertions = true -overflow-checks = true -lto = false -panic = 'unwind' -incremental = true -rpath = false # The release profile, used for `cargo build --release`. [profile.release] -opt-level = 3 -debug = false -debug-assertions = false -overflow-checks = false -lto = true -panic = 'unwind' -incremental = false +# Enables "fat" LTO, for faster release builds +lto = "fat" +# Makes sure that all code is compiled together, for LTO codegen-units = 1 -rpath = false # The test profile, used for `cargo test`. [profile.test] +# Enables thin local LTO and some optimizations. opt-level = 1 -debug = true -debug-assertions = true -overflow-checks = true -lto = false -incremental = true -rpath = false # The benchmark profile, used for `cargo bench`. [profile.bench] -opt-level = 3 -debug = false -debug-assertions = false -overflow-checks = false -lto = true -incremental = false +# Enables "fat" LTO, for faster benchmark builds +lto = "fat" +# Makes sure that all code is compiled together, for LTO codegen-units = 1 -rpath = false