Skip to content

Commit 9a01ac3

Browse files
committed
build: add documentation for running benchmarks
Adds documentation for running benchmarks.
1 parent 28961e8 commit 9a01ac3

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

docs/BENCHMARKS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Benchmarks
2+
3+
- Benchmarks code can be found in: `/modules/benchmarks/src`.
4+
- Benchmarks convenience script code in `/scripts/benchmarks`.
5+
- Benchpress (the sample runner) in `/packages/benchpress`.
6+
7+
### Running benchmark
8+
9+
```
10+
yarn benchmarks run
11+
```
12+
13+
### Running a comparison with local changes
14+
15+
```
16+
yarn benchmarks run-compare main
17+
yarn benchmarks run-compare <compare-sha> [bazel-target]
18+
```
19+
20+
If no benchmark target is specified, a prompt will allow you to select an available benchmark.
21+
22+
### Running a comparison in a PR
23+
24+
You can start a comparison by adding a comment as followed to any PR:
25+
26+
```
27+
/benchmark-compare main //modules/benchmarks/src/expanding_rows:perf_chromium
28+
```
29+
30+
```
31+
/benchmark-compare <other-sha> //modules/benchmarks/src/expanding_rows:perf_chromium
32+
```
33+
34+
**Note**: An explicit benchmark target must be provided. You can use the prompt of `yarn benchmarks run` to
35+
discover available benchmarks.

scripts/benchmarks/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Benchmarks script
2+
3+
This folder contains a convenience script for running benchmarks and performing comparisons. It can
4+
be run via `yarn benchmarks`. See command line help for possible commands.
5+
6+
The benchmark script is used in conjunction with the benchmark compare GitHub actions workflow, allowing
7+
organization members to initiate a benchmark comparison via a GitHub comment in a PR.
8+
9+
### Docs
10+
11+
See ![the benchmark documentation](../../docs/BENCHMARKS.md).

0 commit comments

Comments
 (0)