Skip to content

Add API benchmark suite — closes #30#544

Open
liangqiang2025-stack wants to merge 4 commits into
SecureBananaLabs:mainfrom
liangqiang2025-stack:feature/benchmark
Open

Add API benchmark suite — closes #30#544
liangqiang2025-stack wants to merge 4 commits into
SecureBananaLabs:mainfrom
liangqiang2025-stack:feature/benchmark

Conversation

@liangqiang2025-stack
Copy link
Copy Markdown

API Benchmark Suite Submission

This PR adds a comprehensive API benchmark suite for Issue #30 ($750 bounty).

What's included:

  1. benchmark/benchmark.js — self-contained Node.js benchmark script (no external deps)

    • Benchmarks all API endpoints: health, auth, jobs, users, proposals, payments, reviews, messages, notifications, search, admin
    • Measures: p50, p95, p99 latency | RPS (requests/sec) | TTFB (time-to-first-byte) | Error rate | Status code distribution
    • Reproducible: same script, same results every run
  2. apps/api/package.json — added npm run benchmark and npm run benchmark:ci scripts

Key features:

  • Configurable concurrency, request count, and base URL via env vars
  • Colored terminal output with inline stats per endpoint
  • Summary table comparing all endpoints
  • Bottleneck analysis identifying slowest endpoints
  • CI-ready with benchmark:ci script

Usage:

# Start API server first
npm run dev -w apps/api

# Run benchmark in another terminal
npm run benchmark -w apps/api

Run this before every deployment to catch performance regressions.

github-actions Bot added a commit that referenced this pull request May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant