From a7d21144f00003497048d3dbaa80cb32037b048b Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Thu, 9 Apr 2026 22:52:28 +0000 Subject: [PATCH] perf: bump benchmark iterations from 5 to 30 and wire up workflow input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With only 5 iterations, P95/P99/max are all the same value — no statistical significance in percentile calculations. Bumping to 30 gives meaningful tail-latency data (P95 = 2nd-worst of 30 runs). Changes: - Read iteration count from AWF_BENCHMARK_ITERATIONS env var (default 30) - Pass workflow_dispatch iterations input to the script via env var - Increase workflow timeout from 30 to 90 minutes for more iterations Closes #1864 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/performance-monitor.yml | 6 ++++-- scripts/ci/benchmark-performance.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/performance-monitor.yml b/.github/workflows/performance-monitor.yml index 4772a3cdd..da970e6c1 100644 --- a/.github/workflows/performance-monitor.yml +++ b/.github/workflows/performance-monitor.yml @@ -9,7 +9,7 @@ on: iterations: description: "Number of iterations per metric" required: false - default: "5" + default: "30" permissions: contents: read @@ -19,7 +19,7 @@ jobs: benchmark: name: Run Performance Benchmarks runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 90 steps: - name: Checkout uses: actions/checkout@v4 @@ -46,6 +46,8 @@ jobs: - name: Run benchmarks id: benchmark + env: + AWF_BENCHMARK_ITERATIONS: ${{ github.event.inputs.iterations || '30' }} run: | npx tsx scripts/ci/benchmark-performance.ts > benchmark-results.json 2>benchmark-progress.log || true cat benchmark-progress.log diff --git a/scripts/ci/benchmark-performance.ts b/scripts/ci/benchmark-performance.ts index 414b62aee..8afd97672 100644 --- a/scripts/ci/benchmark-performance.ts +++ b/scripts/ci/benchmark-performance.ts @@ -20,7 +20,7 @@ import { stats, parseMb, checkRegressions, BenchmarkResult, BenchmarkReport } fr // ── Configuration ────────────────────────────────────────────────── -const ITERATIONS = 5; +const ITERATIONS = parseInt(process.env.AWF_BENCHMARK_ITERATIONS || '30', 10); const AWF_CMD = "sudo awf"; const ALLOWED_DOMAIN = "api.github.com"; const CLEANUP_CMD = "sudo docker compose down -v 2>/dev/null; sudo docker rm -f awf-squid awf-agent 2>/dev/null; sudo docker network prune -f 2>/dev/null";