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