From 5206dab7b5fea3b39229854609c163ef2031f743 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Tue, 29 Aug 2023 13:40:24 +0800 Subject: [PATCH] Tweak build options for faster tool build Previously building inputmodule-control would be as slow as 20s even with no code change. Now it takes just less than 1s. - Remove all options that are default - no need to specify them again. - Keep the release options the same (Still slow tool build but not as important) - Apply the dev options only to the firmware, not tool Signed-off-by: Daniel Schaefer --- Cargo.toml | 50 +++++++++++--------------------------------------- 1 file changed, 11 insertions(+), 39 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dd419f8f..d4cef39f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,55 +45,27 @@ tinybmp = "0.5.0" smart-leds = "0.3.0" ws2812-pio = "0.6.0" -# cargo build/run -[profile.dev] +[profile.dev.package.ledmatrix] codegen-units = 1 -debug = 2 -debug-assertions = true -incremental = false +incremental = true # To allow single-stepping through code use 0. Will cause timing issues, though opt-level = 3 -overflow-checks = true -# cargo build/run --release -[profile.release] +[profile.dev.package.c1minimal] codegen-units = 1 -debug = 2 -debug-assertions = false -incremental = false -lto = 'fat' +incremental = true +# To allow single-stepping through code use 0. Will cause timing issues, though opt-level = 3 -overflow-checks = false - -# do not optimize proc-macro crates = faster builds from scratch -[profile.dev.build-override] -codegen-units = 8 -debug = false -debug-assertions = false -opt-level = 0 -overflow-checks = false -[profile.release.build-override] -codegen-units = 8 -debug = false -debug-assertions = false -opt-level = 0 -overflow-checks = false - -# cargo test -[profile.test] +[profile.dev.package.b1display] codegen-units = 1 -debug = 2 -debug-assertions = true -incremental = false +incremental = true +# To allow single-stepping through code use 0. Will cause timing issues, though opt-level = 3 -overflow-checks = true -# cargo test --release -[profile.bench] +# Faster and smaller code but much slower to compile. +# Increase in rebuild time from <1s to 20s +[profile.release] codegen-units = 1 debug = 2 -debug-assertions = false -incremental = false lto = 'fat' -opt-level = 3