You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+69Lines changed: 69 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -590,6 +590,75 @@ Removes the `full-ci` label and returns to standard CI behavior:
590
590
-**Force-pushes:** The `/run-skipped-ci` command adds the `full-ci` label to your PR. If you force-push after commenting, the initial workflow run will test the old commit, but subsequent pushes will automatically run full CI because the label persists.
591
591
-**Branch operations:** Avoid deleting or force-pushing branches while workflows are running, as this may cause failures.
592
592
593
+
### Benchmarking
594
+
595
+
React on Rails includes a performance benchmark workflow that measures RPS (requests per second) and latency for both Core and Pro versions.
596
+
597
+
#### When Benchmarks Run
598
+
599
+
-**Automatically on master**: Benchmarks run on every push to master
600
+
-**On PRs with labels**: Add the `benchmark` or `full-ci` label to your PR to run benchmarks
601
+
-**Manual trigger**: Use `gh workflow run` to run benchmarks with custom parameters (see [https://github.com/cli/cli#installation](https://github.com/cli/cli#installation) if you don't have `gh`):
602
+
603
+
```bash
604
+
# Run with default parameters
605
+
gh workflow run benchmark.yml
606
+
607
+
# Run with custom parameters
608
+
gh workflow run benchmark.yml \
609
+
-f rate=100 \
610
+
-f duration=60s \
611
+
-f connections=20 \
612
+
-f app_version=core_only
613
+
```
614
+
615
+
#### Regression Detection
616
+
617
+
When benchmarks run, the [github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark) action compares results against historical data. If performance regresses by more than 50%, the workflow will:
618
+
619
+
1.**Fail the CI check** with `fail-on-alert: true`
620
+
2.**Post a comment on the PR** explaining the regression
621
+
3.**Tag reviewers** for attention
622
+
623
+
This helps catch performance regressions before they reach production.
624
+
625
+
#### Running Benchmarks Locally
626
+
627
+
**Prerequisites:** Install [k6](https://k6.io/docs/get-started/installation/) and [Vegeta](https://github.com/tsenart/vegeta#install).
628
+
629
+
You can also run the server in a separate terminal instead of backgrounding it.
**Configuration:** Both scripts support environment variables for customization (rate, duration, connections, etc.). See the script headers in [`benchmarks/bench.rb`](benchmarks/bench.rb) and [`benchmarks/bench-node-renderer.rb`](benchmarks/bench-node-renderer.rb) for available options. For debugging, you may want lower `DURATION` and/or specific `ROUTES`:
657
+
658
+
```bash
659
+
DURATION=5s ROUTES=/ ruby benchmarks/bench.rb
660
+
```
661
+
593
662
### Install Generator
594
663
595
664
In your Rails app add this gem with a path to your fork.
0 commit comments