Performance benchmarks for plans and subscriptions list endpoints.
# Quick run
go test ./internal/handlers/... -bench=. -benchmem
# Full suite with scripts
./scripts/run_benchmarks.sh
# Compare with baseline
./scripts/analyze_benchmarks.sh baseline.txt new.txtThe repository includes a k6 smoke profile that exercises the API with real HTTP requests and authorization. It validates end-to-end service behavior under load and enforces:
- p95 latency <
250ms - error rate <
0.1%
make loadtest-smokeFor remote targets, set LOADTEST_TARGET and JWT_SECRET:
LOADTEST_TARGET=https://staging.example.com \
JWT_SECRET=${JWT_SECRET} \
make loadtest-smoke- Empty, Small (10), Medium (100), Large (1K), XLarge (10K)
- Isolates serialization performance
- Complete request/response cycle
- Concurrent request handling
- Query parameter filtering
See BENCHMARK_GUIDE.md for detailed baselines and thresholds.
Benchmarks run automatically on PRs to detect regressions.
Use benchstat for statistical comparison:
go install golang.org/x/perf/cmd/benchstat@latest
benchstat baseline.txt new.txt