ci(benchmark): Add performance benchmark workflow for PRs#1252
ci(benchmark): Add performance benchmark workflow for PRs#1252
Conversation
Add a GitHub Actions workflow that benchmarks repomix by packing its own repository on both the PR branch and main branch, then posts a comparison comment on the PR. The comment is updated in-place on subsequent pushes. Key design decisions: - Checkout PR and main into separate directories for measurement isolation - 2 warmup runs + 5 measured runs, reporting the median - Concurrency group to cancel outdated runs on the same PR Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughA new GitHub Actions workflow for performance benchmarking was added. It checks out both the PR and main branches, builds each, runs the repomix CLI tool 5 times per branch with 2 warmup runs, calculates median runtimes, computes timing differences, and posts results as a PR comment. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⚡ Performance BenchmarkPacking the repomix repository with
Details
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1252 +/- ##
=======================================
Coverage 87.18% 87.18%
=======================================
Files 115 115
Lines 4324 4324
Branches 1002 1002
=======================================
Hits 3770 3770
Misses 554 554 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Deploying repomix with
|
| Latest commit: |
1d73cec
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://33779137.repomix.pages.dev |
| Branch Preview URL: | https://ci-perf-benchmark.repomix.pages.dev |
Use matrix strategy to benchmark on all three OSes. Results are aggregated into a single PR comment table. Key changes: - Matrix strategy with fail-fast: false for ubuntu, macos, windows - Node.js-based timing (execFileSync + Date.now()) for cross-platform support - Each OS uploads its result as an artifact - Separate comment job downloads all artifacts and generates comparison table Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Improve benchmark stability and visibility: - Increase measurement runs from 5 to 10 for more stable medians - Add IQR (interquartile range) display as ± to show measurement variance - Table now shows e.g. "2.51s (±0.15s)" for each measurement Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move pull-requests: write to comment job level (not workflow level) - Pin actions/download-artifact to SHA (v6.0.0) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Address review feedback: - Change comment job condition from `always()` to `!cancelled()` to avoid posting empty results when workflow is cancelled by concurrency group - Split report generation and comment posting into separate steps - Skip PR comment on fork PRs (GITHUB_TOKEN is read-only) - Write benchmark report to Job Summary as fallback, visible in Actions tab for both fork and non-fork PRs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Code Review (Final): Previous reviews tracked 4 issues. 3/4 addressed. Still open: diff_pct N/A formatting (Line 163) - when main_ms=0, diff_pct is N/A but line 163 appends percent unconditionally. Resolved: download-artifact pinned to SHA, always() to !cancelled(), fork PR handling. LGTM with minor fix. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Link to the workflow run for easy re-run access. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Code Review (Follow-up): Still 1 open issue. diff_pct N/A formatting (line 163) - when main_ms=0, diff_pct is N/A but line 163 appends percent unconditionally producing N/A percent. Fix by using a diff_pct_fmt variable. Minor note: PR description says 5 measured runs but code does 10. LGTM with that fix. |
Code Review (Updated)Previous reviews tracked 4 issues. 3 of 4 addressed — nice work on the iterations. The workflow is well-designed overall. Still opendiff_pct N/A% formatting (Line 163) Minor suggestion (non-blocking)DetailsMultiple node -e invocations to parse the same JSON (Lines 141-147) Five separate node -e calls parse the same JSON. A single invocation or using jq (pre-installed on all GitHub-hosted runners) would be cleaner and faster. Premortem
Verdict: LGTM with the minor N/A% fix. Generated with Claude Code |
Add a GitHub Actions workflow that benchmarks repomix by packing its own repository, comparing PR branch vs main branch performance.
How it works
Comment example
Design decisions
<!-- repomix-perf-benchmark -->) to find and update existing commentsChecklist
npm run testnpm run lint🤖 Generated with Claude Code