Files
foxhunt/config/alternative/Cargo.toml.optimized
jgrusewski 8d89fe80ff chore: Second cleanup wave - organize root directory
- Archive: 85 agent .txt files → docs/archive/agents/legacy_txt/
- Scripts: Move 110 shell scripts → scripts/ (keep deploy.sh in root)
- Models: Move 18 .safetensors → ml/models/checkpoints/training_artifacts/
- Delete: 34 directories (~33GB freed) - target/, coverage_*, test artifacts
- Build: Clean 14 build artifacts (.rlib, .o, .pid, binaries)
- Tests: Move 14 .rs files → tests/standalone/
- SQL: Move 5 files → sql/ (keep init-db*.sql for Docker)
- Wave 153: Archive to docs/archive/historical/wave153/
- Docs: Archive 9 markdown files to wave_d/reports/ and historical/

Total impact: ~34GB freed (both waves), root directory cleaned from 583 to ~40 essential files
Directory count reduced from 65 to 31 (52% reduction)
All historical data preserved in organized archive structure
2025-10-30 01:26:02 +01:00

103 lines
4.0 KiB
Plaintext

# OPTIMIZED Cargo.toml - Rust Compile-Time Optimization Flags
# Generated: 2025-10-25
# See: AGENT_15_RUST_COMPILER_OPTIMIZATION_ANALYSIS.md
#
# USAGE:
# 1. Backup current Cargo.toml: cp Cargo.toml Cargo.toml.backup
# 2. Review profile changes below (lines 401-460)
# 3. Replace [profile.*] sections in main Cargo.toml
# 4. Test with: cargo build --release --profile release-pgo
# ... (Keep all existing package, dependencies, workspace sections unchanged)
# ============================================================================
# OPTIMIZED PROFILE CONFIGURATIONS
# ============================================================================
[profile.release]
opt-level = 3 # Maximum optimization level
lto = "fat" # Whole-program link-time optimization
codegen-units = 1 # Single compilation unit for max optimization
panic = "abort" # Minimal panic overhead
strip = false # CHANGED: Keep symbols for BOLT post-link optimization
debug = false # No debug info
debug-assertions = false # Runtime checks disabled
overflow-checks = false # Math performance optimized
# PROFILE-GUIDED OPTIMIZATION (PGO) - RECOMMENDED FOR PRODUCTION
# Expected: 5-15% performance improvement in CPU-bound hot paths
# Use: cargo pgo build && <run workload> && cargo pgo optimize
[profile.release-pgo]
inherits = "release"
# No additional flags - PGO metadata handled by cargo-pgo
# See: AGENT_15_RUST_COMPILER_OPTIMIZATION_ANALYSIS.md section "Priority 1"
# PROFILING BUILDS - Keep debug info for perf profiling
# Use: cargo build --release --profile release-profile
# Then: perf record -g ./target/release-profile/foxhunt-core
[profile.release-profile]
inherits = "release"
debug = true # Full debug info for symbolization
strip = false # Keep all symbols
# Note: force-frame-pointers=yes set in .cargo/config.toml (target.profile)
# PRODUCTION BUILDS - Zero profiling overhead
# Use: cargo build --release --profile release-production
# Expected: ~1% improvement vs. release (frame pointer overhead eliminated)
[profile.release-production]
inherits = "release"
strip = true # Remove all symbols for minimal binary size
# Note: force-frame-pointers=no (not set in rustflags for this profile)
# TEST PROFILE - Fast compilation, zero optimization
[profile.test]
opt-level = 0 # Disable optimizations for faster test compilation
debug = 0 # Remove debug info completely for faster linking
debug-assertions = false # Disabled for faster test compilation
overflow-checks = false # Disabled for faster test compilation
lto = false
incremental = true
codegen-units = 256 # Maximum parallelism for test builds
split-debuginfo = "unpacked" # Faster linking on Linux
# DEVELOPMENT PROFILE - Fast iteration
[profile.dev]
split-debuginfo = "unpacked" # Faster linking for dev builds
# BENCHMARK PROFILE - Matches release exactly
[profile.bench]
inherits = "release"
debug = false
# HFT PROFILE - High-frequency trading optimized
[profile.hft]
inherits = "release"
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = false
overflow-checks = false
# ============================================================================
# PERFORMANCE OPTIMIZATION NOTES
# ============================================================================
#
# CURRENT BASELINE: 922x faster than targets (excellent)
# OPTIMIZATION POTENTIAL: 12-28% additional performance (average: 22%)
# RECOMMENDED APPROACH: Incremental implementation over 1 month
#
# Phase 1 (Week 1): Quick Wins (7-22% improvement)
# 1. PGO: 5-15% improvement (Priority 1)
# 2. Static linking: <1% latency, reduced jitter (Priority 2)
# 3. Native CPU: 0-5% improvement (Priority 3)
# 4. Separate profiles: ~1% improvement (Priority 4)
#
# Phase 2 (Weeks 2-4): Advanced Optimizations (3-11% improvement)
# 5. Allocator tuning: 1-3% improvement (Priority 5)
# 6. BOLT post-link: 2-8% improvement (Priority 6)
#
# TOTAL EXPECTED IMPACT: 1,032-1,180x vs. targets (average: 1,125x)
#
# See: AGENT_15_RUST_COMPILER_OPTIMIZATION_ANALYSIS.md for full details