build: enable thin LTO and single codegen units for release

Smaller/faster production binary (verified: cargo build --release -p
xmedia-bot builds clean with the new profile). panic=abort is
intentionally not set — queue workers and db closures rely on JoinHandle
catching panics, which abort would defeat.
This commit is contained in:
2026-08-13 22:42:42 +08:00
parent ad59f518ff
commit 6b9640aa48
+6 -1
View File
@@ -2,6 +2,11 @@
members = ["crates/x-media", "crates/xmedia-bot"]
resolver = "3"
# Smaller production binary; debug symbols are not shipped anyway.
# Smaller/faster production binary: strip debug symbols, link-time
# optimization across crates, and one codegen unit per crate (bigger LTO
# wins). panic=abort is intentionally NOT set: queue workers and db
# closures rely on JoinHandle catching panics, which abort would defeat.
[profile.release]
strip = true
lto = "thin"
codegen-units = 1