Skip to content

Commit 2c75e71

Browse files
authored
Merge pull request #10229 from sylvestre/bench-mem
benchmarks: Add memory benchmarks
2 parents 450e7cf + 887a7ba commit 2c75e71

File tree

1 file changed

+40
-34
lines changed

1 file changed

+40
-34
lines changed

.github/workflows/benchmarks.yml

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,38 @@ concurrency:
1818

1919
jobs:
2020
benchmarks:
21-
name: Run benchmarks (CodSpeed)
21+
name: Run ${{ matrix.type }} benchmarks for ${{ matrix.package }} (CodSpeed)
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
benchmark-target:
26-
- { package: uu_base64 }
27-
- { package: uu_cksum }
28-
- { package: uu_cp }
29-
- { package: uu_cut }
30-
- { package: uu_dd }
31-
- { package: uu_df }
32-
- { package: uu_du }
33-
- { package: uu_expand }
34-
- { package: uu_fold }
35-
- { package: uu_join }
36-
- { package: uu_ls }
37-
- { package: uu_mv }
38-
- { package: uu_nl }
39-
- { package: uu_numfmt }
40-
- { package: uu_rm }
41-
- { package: uu_seq }
42-
- { package: uu_shuf }
43-
- { package: uu_sort }
44-
- { package: uu_split }
45-
- { package: uu_tsort }
46-
- { package: uu_unexpand }
47-
- { package: uu_uniq }
48-
- { package: uu_wc }
49-
- { package: uu_factor }
50-
- { package: uu_date }
25+
type: [performance, memory]
26+
package: [
27+
uu_base64,
28+
uu_cksum,
29+
uu_cp,
30+
uu_cut,
31+
uu_dd,
32+
uu_df,
33+
uu_du,
34+
uu_expand,
35+
uu_fold,
36+
uu_join,
37+
uu_ls,
38+
uu_mv,
39+
uu_nl,
40+
uu_numfmt,
41+
uu_rm,
42+
uu_seq,
43+
uu_shuf,
44+
uu_sort,
45+
uu_split,
46+
uu_tsort,
47+
uu_unexpand,
48+
uu_uniq,
49+
uu_wc,
50+
uu_factor,
51+
uu_date
52+
]
5153
steps:
5254
- uses: actions/checkout@v6
5355
with:
@@ -64,19 +66,23 @@ jobs:
6466
shell: bash
6567
run: cargo install cargo-codspeed --locked
6668

67-
- name: Build benchmarks for ${{ matrix.benchmark-target.package }}
69+
- name: Build benchmarks for ${{ matrix.package }} (${{ matrix.type }})
6870
shell: bash
6971
run: |
70-
echo "Building benchmarks for ${{ matrix.benchmark-target.package }}"
71-
cargo codspeed build -p ${{ matrix.benchmark-target.package }}
72+
echo "Building ${{ matrix.type }} benchmarks for ${{ matrix.package }}"
73+
if [ "${{ matrix.type }}" = "memory" ]; then
74+
cargo codspeed build -m analysis -p ${{ matrix.package }}
75+
else
76+
cargo codspeed build -p ${{ matrix.package }}
77+
fi
7278
73-
- name: Run benchmarks for ${{ matrix.benchmark-target.package }}
79+
- name: Run ${{ matrix.type }} benchmarks for ${{ matrix.package }}
7480
uses: CodSpeedHQ/action@v4
7581
env:
7682
CODSPEED_LOG: debug
7783
with:
78-
mode: simulation
84+
mode: ${{ matrix.type == 'memory' && 'memory' || 'simulation' }}
7985
run: |
80-
echo "Running benchmarks for ${{ matrix.benchmark-target.package }}"
81-
cargo codspeed run -p ${{ matrix.benchmark-target.package }} > /dev/null
86+
echo "Running ${{ matrix.type }} benchmarks for ${{ matrix.package }}"
87+
cargo codspeed run -p ${{ matrix.package }} > /dev/null
8288
token: ${{ secrets.CODSPEED_TOKEN }}

0 commit comments

Comments
 (0)