Run performance benchmarks on code or endpoints.
Runs performance benchmarks on code or endpoints with detailed metrics and analysis.
/plugin marketplace add marcel-Ngan/ai-dev-team/plugin install marcel-ngan-ai-dev-team@marcel-Ngan/ai-dev-teamRun performance benchmarks on code or endpoints.
/benchmark [target] [--type function|api|load]
Arguments:
target - Function, file, or API endpoint to benchmark--type - Benchmark type (default: auto-detect)/benchmark src/utils/parser.ts
/benchmark processData --type function
/benchmark /api/users --type api
/benchmark /api/search --type load
## Benchmark Results: processData()
**Target:** src/utils/parser.ts:processData
**Iterations:** 10,000
**Date:** 2024-01-15 10:30:00
### Execution Time
| Metric | Value |
|--------|-------|
| Average | 2.34ms |
| Median | 2.12ms |
| Min | 1.89ms |
| Max | 8.45ms |
| P95 | 3.21ms |
| P99 | 5.67ms |
| Std Dev | 0.89ms |
### Memory
| Metric | Value |
|--------|-------|
| Avg Allocation | 1.2MB |
| Peak | 4.8MB |
| GC Pauses | 12 |
### Throughput
- **Operations/sec:** 427
- **Data processed:** 42.7 MB/sec
### Comparison
| Version | Avg Time | Change |
|---------|----------|--------|
| Current | 2.34ms | - |
| Previous | 2.89ms | -19% faster |
| Baseline | 3.45ms | -32% faster |
### Visualization
Response Time Distribution: 1-2ms |████████████████████ 45% 2-3ms |██████████████ 32% 3-4ms |██████ 15% 4-5ms |██ 5% 5ms+ |█ 3%
### Recommendations
1. P99 latency is 2.4x average - investigate outliers
2. Memory allocation high - consider object pooling
3. Performance meets target (<5ms avg)
performance-benchmarking
# Add to CI pipeline
benchmark:
script:
- /benchmark src/critical-path/ --type function
- /benchmark /api/core-endpoints --type api
allow_failure: false
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request"
Use the Software Architect agent when: