From 0d4f3b9185a5c7ca7442f5d9d936076d70739c7c Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:41:52 +0200 Subject: [PATCH] chore: compile dependencies with optimizations in dev mode Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com> --- Cargo.toml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index af44f09..df3a82b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,3 +48,44 @@ tokio = { version = "1", features = ["full"] } toml = "0.8.0" tungstenite = "0.20" url = "2.4" + +# see: https://nnethercote.github.io/perf-book/build-configuration.html +[profile.dev] +opt-level = 0 +debug = true +rpath = false +lto = false +debug-assertions = true +codegen-units = 4 + +# compile dependencies with optimizations in dev mode +# see: https://doc.rust-lang.org/stable/cargo/reference/profiles.html#overrides +[profile.dev.package."*"] +opt-level = 3 +debug = true + +[profile.release] +opt-level = 3 +debug = false # true for profiling +rpath = false +lto = "fat" +debug-assertions = false +codegen-units = 1 +strip = true +panic = "abort" + +[profile.test] +opt-level = 1 +debug = true +rpath = false +lto = false +debug-assertions = true +codegen-units = 4 + +[profile.bench] +opt-level = 3 +debug = true # true for profiling +rpath = false +lto = true +debug-assertions = false +codegen-units = 1