#!/bin/bash # Comprehensive Performance Benchmark Runner # Wave 125 - Agent 90 set -e echo "╔════════════════════════════════════════════════════════════════╗" echo "║ Foxhunt HFT System - Comprehensive Performance Suite ║" echo "╚════════════════════════════════════════════════════════════════╝" echo "" # Color codes GREEN='\033[0;32m' BLUE='\033[0;34m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Create output directory OUTPUT_DIR="benchmark_results_$(date +%Y%m%d_%H%M%S)" mkdir -p "$OUTPUT_DIR" echo -e "${BLUE}Output directory: $OUTPUT_DIR${NC}" echo "" # Function to run benchmark category run_benchmark() { local category=$1 local name=$2 echo -e "${YELLOW}Running $name...${NC}" cargo bench -p trading_engine --bench comprehensive_performance "$category" \ 2>&1 | tee "$OUTPUT_DIR/${category}_benchmark.log" echo -e "${GREEN}✓ $name complete${NC}" echo "" } # 1. Order Processing run_benchmark "order_processing" "Order Processing Benchmarks" # 2. Position Management run_benchmark "position_management" "Position Management Benchmarks" # 3. Market Data run_benchmark "market_data" "Market Data Processing Benchmarks" # 4. Risk Management run_benchmark "risk_management" "Risk Management Benchmarks" # 5. Compliance run_benchmark "compliance" "Compliance & Audit Benchmarks" # 6. Throughput run_benchmark "throughput" "Throughput Validation Benchmarks" # 7. Memory run_benchmark "memory" "Memory Efficiency Benchmarks" # 8. Comprehensive Validation run_benchmark "validation" "Comprehensive Target Validation" echo "" echo "╔════════════════════════════════════════════════════════════════╗" echo "║ All Benchmarks Complete ║" echo "╚════════════════════════════════════════════════════════════════╝" echo "" echo -e "${GREEN}Results saved to: $OUTPUT_DIR/${NC}" echo "" echo "View HTML report:" echo " open target/criterion/report/index.html" echo "" echo "View logs:" echo " ls -lh $OUTPUT_DIR/" echo ""