update build profile

This commit is contained in:
xfy
2025-03-26 13:54:32 +08:00
parent 6cb458fe01
commit 3f2ea6af27

View File

@ -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"]