Generate Performance Tests
Target: $ARGUMENTS
- Read the target file and understand what to benchmark.
- Detect available tools:
cat package.json | grep -E "vitest|jest|benchmark|autocannon|k6"
- Write benchmarks that measure:
- Execution time under normal load
- Memory allocation
- Degradation under large inputs (10x, 100x, 1000x)
- Comparison: current implementation vs a naive baseline
- For HTTP endpoints: generate a load test script (autocannon or k6).
- Add a performance budget comment:
// Expected: < 10ms for typical input
// Regression threshold: fail if > 50ms
- Place benchmark file in
bench/or__benchmarks__/following project conventions.