diff --git a/frameworks/Rust/axum/Cargo.toml b/frameworks/Rust/axum/Cargo.toml index 0f69289..1fe7d2e 100644 --- a/frameworks/Rust/axum/Cargo.toml +++ b/frameworks/Rust/axum/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["profile-rustflags", "trim-paths"] + [package] name = "phthonus" version = "0.1.0" @@ -29,9 +31,15 @@ rand = "0.9.0" validator = { version = "0.20.0", features = ["derive"] } jsonwebtoken = "9.3.1" +[profile.dev] +incremental = true # Compile your binary in smaller steps. +rustflags = ["-Zthreads=8"] # Better compile performance. + [profile.release] -lto = true -panic = "abort" # Strip expensive panic clean-up logic -codegen-units = 1 # Compile crates one after another so the compiler can optimize better -# opt-level = "s" # Optimize for binary size -strip = true # Remove debug symbols +codegen-units = 1 # Allows LLVM to perform better optimization. +lto = true # Enables link-time-optimizations. +opt-level = 3 # Prioritizes small binary size. Use `3` if you prefer speed. +panic = "abort" # Higher performance by disabling panic handlers. +strip = true # Ensures debug symbols are removed. +trim-paths = "all" # Removes potentially privileged information from your binaries. +rustflags = ["-Cdebuginfo=0", "-C", "target-cpu=native", "-Z", "threads=8"]