# OPTIMIZED .cargo/config.toml - Rust Compile-Time Optimization Flags # Generated: 2025-10-25 # See: AGENT_15_RUST_COMPILER_OPTIMIZATION_ANALYSIS.md [env] SQLX_OFFLINE = "false" [cargo-new] vcs = "none" [net] git-fetch-with-cli = true [build] jobs = 16 incremental = true pipelining = true # PRODUCTION BUILDS - Runpod deployment (portable x86-64-v3) # Use: cargo build --release [target.x86_64-unknown-linux-gnu] rustflags = [ # Security hardening "-C", "link-arg=-Wl,-z,relro,-z,now", "-C", "link-arg=-Wl,--as-needed", # CPU optimization (portable baseline for Runpod V100/RTX 4090) "-C", "target-cpu=x86-64-v3", "-C", "target-feature=+avx2,+fma,+bmi2", # Compiler optimization "-C", "opt-level=3", "-C", "codegen-units=1", ] # LOCAL DEVELOPMENT - Maximum performance (uses all CPU features) # Use: cargo build --release --config target.x86_64-unknown-linux-gnu.local [target.x86_64-unknown-linux-gnu.local] rustflags = [ # USE ALL CPU FEATURES (i7-11800H: AVX-512, ADX, SHA-NI, etc.) "-C", "target-cpu=native", # Compiler optimization "-C", "opt-level=3", "-C", "codegen-units=1", "-C", "lto=fat", ] # STATIC LINKING - Zero dynamic dependencies (musl target) # Use: cargo build --release --target x86_64-unknown-linux-musl [target.x86_64-unknown-linux-musl] rustflags = [ # CPU optimization (use all local features) "-C", "target-cpu=native", "-C", "target-feature=+avx2,+fma,+bmi2,+adx", # Static linking "-C", "link-arg=-static", # Compiler optimization "-C", "opt-level=3", "-C", "codegen-units=1", ] # PROFILING BUILDS - Keep frame pointers for perf profiling # Use: cargo build --release --profile release-profile [target.x86_64-unknown-linux-gnu.profile] rustflags = [ # Security hardening "-C", "link-arg=-Wl,-z,relro,-z,now", "-C", "link-arg=-Wl,--as-needed", # CPU optimization "-C", "target-cpu=x86-64-v3", "-C", "target-feature=+avx2,+fma,+bmi2", # Profiling support "-C", "force-frame-pointers=yes", # Compiler optimization "-C", "opt-level=3", "-C", "codegen-units=1", ] [term] verbose = false progress.when = "auto" # LEGACY PROFILES (for backwards compatibility) [profile.release] opt-level = 3 lto = "fat" codegen-units = 1 panic = "abort" strip = false # CHANGED: Keep symbols for BOLT optimization debug = false overflow-checks = false [profile.bench] inherits = "release" debug = false [profile.hft] inherits = "release" opt-level = 3 lto = "fat" codegen-units = 1 panic = "abort" strip = false overflow-checks = false