Skip to content

Commit 25749b4

Browse files
chore: add basic benchmarks (#34)
* refactor: implement defaults for command arguments * refactor: allow running `get` and `list` without writing to stdout, for benchmarking * chore: implement basic benchmarks * ci: benchmark comparison for PRs
1 parent 761c343 commit 25749b4

File tree

8 files changed

+407
-37
lines changed

8 files changed

+407
-37
lines changed

.github/workflows/bench.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CodSpeed benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
benchmarks:
12+
name: Run benchmarks
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5
16+
- name: Setup rust toolchain, cache and cargo-codspeed binary
17+
uses: moonrepo/setup-rust@v1
18+
with:
19+
channel: stable
20+
cache-target: release
21+
bins: cargo-codspeed
22+
- name: Build the benchmark target(s)
23+
run: cargo codspeed build
24+
- name: Run the benchmarks
25+
uses: CodSpeedHQ/action@v4
26+
with:
27+
mode: instrumentation
28+
run: cargo codspeed run
29+
token: ${{ secrets.CODSPEED_TOKEN }}

Cargo.lock

Lines changed: 209 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ base64 = "0.22"
4949
tempfile = "3.23"
5050
proptest = "1.9"
5151
insta = "1.43"
52+
divan = { version = "4.1.0", package = "codspeed-divan-compat" }
53+
54+
[[bench]]
55+
name = "base"
56+
harness = false
5257

5358
[profile.release]
5459
strip = true

0 commit comments

Comments
 (0)