# Performance Benchmark Results

**Date**: 2025-11-30 19:45:17
**Scripts Tested**: 12
**Passed**: 8/12 (66.7%)

## Executive Summary

### Critical Performance: analyze_all.py

- **Target**: <2.5s
- **Actual**: 2.145s
- **Status**: ✅ PASS
- **Min/Max**: 2.143s / 2.146s

## Detailed Results

| Script | Target | Run 1 | Run 2 | Run 3 | Average | Min | Max | Status |
|--------|--------|-------|-------|-------|---------|-----|-----|--------|
| status.py | <0.5s | 1.493s | 1.092s | 1.060s | 1.215s | 1.060s | 1.493s | ❌ |
| analyze_cpu.py | <0.5s | 2.073s | 2.073s | 2.078s | 2.075s | 2.073s | 2.078s | ❌ |
| analyze_memory.py | <0.5s | 0.111s | 0.106s | 0.104s | 0.107s | 0.104s | 0.111s | ✅ |
| analyze_disk.py | <0.5s | 0.056s | 0.060s | 0.066s | 0.060s | 0.056s | 0.066s | ✅ |
| analyze_network.py | <0.5s | 0.067s | 0.052s | 0.065s | 0.061s | 0.052s | 0.067s | ✅ |
| analyze_battery.py | <0.5s | 0.223s | 0.168s | 0.221s | 0.204s | 0.168s | 0.223s | ✅ |
| analyze_thermal.py | <0.5s | 1.083s | 1.071s | 1.076s | 1.077s | 1.071s | 1.083s | ❌ |
| analyze_all.py | <2.5s | 2.143s | 2.146s | 2.146s | 2.145s | 2.143s | 2.146s | ✅ |
| optimize.py | <3.0s | 2.303s | 2.253s | 2.240s | 2.265s | 2.240s | 2.303s | ✅ |
| report.py | <2.0s | 0.157s | 0.110s | 0.108s | 0.125s | 0.108s | 0.157s | ✅ |
| cache.py | <0.2s | 0.115s | 0.089s | 0.058s | 0.088s | 0.058s | 0.115s | ✅ |
| monitor.py | <10.0s | 15.006s | 15.006s | 15.006s | 15.006s | 15.006s | 15.006s | ❌ |

## Bottlenecks Identified

### Failed Performance Targets

- **status.py**: 1.215s (target: 0.5s, overhead: +0.715s)
- **analyze_cpu.py**: 2.075s (target: 0.5s, overhead: +1.575s)
- **analyze_thermal.py**: 1.077s (target: 0.5s, overhead: +0.577s)
- **monitor.py**: 15.006s (target: 10.0s, overhead: +5.006s)

## Recommendations

### Optimization Priorities

1. **monitor.py**: Focus on reducing execution time by 5.006s
2. **analyze_cpu.py**: Focus on reducing execution time by 1.575s
3. **status.py**: Focus on reducing execution time by 0.715s
4. **analyze_thermal.py**: Focus on reducing execution time by 0.577s

### Performance Characteristics

- **Fast scripts** (<0.3s): analyze_memory.py, analyze_disk.py, analyze_network.py, analyze_battery.py, report.py, cache.py
- **Slow scripts** (≥1.0s): status.py, analyze_cpu.py, analyze_thermal.py, analyze_all.py, optimize.py, monitor.py

## Exit Code Analysis

- **status.py**: ✅ Consistent exit codes {0}
- **analyze_cpu.py**: ✅ Consistent exit codes {0}
- **analyze_memory.py**: ✅ Consistent exit codes {2}
- **analyze_disk.py**: ✅ Consistent exit codes {2}
- **analyze_network.py**: ✅ Consistent exit codes {0}
- **analyze_battery.py**: ✅ Consistent exit codes {1}
- **analyze_thermal.py**: ✅ Consistent exit codes {0}
- **analyze_all.py**: ✅ Consistent exit codes {2}
- **optimize.py**: ✅ Consistent exit codes {0}
- **report.py**: ✅ Consistent exit codes {2}
- **cache.py**: ✅ Consistent exit codes {2}
- **monitor.py**: ⚠️ Unexpected exit codes [-1, -1, -1]


## Performance Regression Tests

See `tests/test_performance/test_script_performance.py` for automated regression tests.

## Benchmark Methodology

- **Runs per script**: 3
- **Measurement**: Wall clock time using `time.time()`
- **Environment**: macOS with UV runtime
- **Timeout**: 15s per script
- **Pause between runs**: 0.5s

---

*Generated by benchmark_all.py*
