Skip to content

Commit 6e80e56

Browse files
authored
chore(ci): Configure automated benchmark for turbopack (#79791)
### What? This PR configures an automated benchmark for turbopack. We can run small benchmarks for all turbopack PRs, and I'll add more benchmarks with follow-up PRs. ### Why? We need a way to track performance consistently.
1 parent 2b7a259 commit 6e80e56

File tree

5 files changed

+133
-110
lines changed

5 files changed

+133
-110
lines changed

.github/workflows/bench.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Turbopack Benchmark
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- canary
8+
paths:
9+
- '**/crates/**'
10+
- '**/Cargo.toml'
11+
- '**/Cargo.lock'
12+
pull_request:
13+
types: ['opened', 'reopened', 'synchronize']
14+
paths:
15+
- '**/crates/**'
16+
- '**/Cargo.toml'
17+
- '**/Cargo.lock'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.sha }}
21+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
22+
23+
env:
24+
CI: 1
25+
CARGO_INCREMENTAL: 0
26+
# For faster CI
27+
RUST_LOG: 'off'
28+
29+
jobs:
30+
benchmark-small:
31+
name: Benchmark Rust Crates (small)
32+
runs-on: ubuntu-22.04
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Setup Rust toolchain
37+
uses: ./.github/actions/setup-rust
38+
39+
- name: Install cargo-codspeed
40+
uses: taiki-e/install-action@v2
41+
with:
42+
43+
44+
- name: Build the benchmark target(s)
45+
run: cargo codspeed build -p turbo-rcstr -p turbopack-ecmascript
46+
47+
- name: Run the benchmarks
48+
uses: CodSpeedHQ/action@v3
49+
with:
50+
run: cargo codspeed run
51+
token: ${{ secrets.CODSPEED_TOKEN }}

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ concurrent-queue = "2.5.0"
340340
console = "0.15.5"
341341
console-subscriber = "0.4.1"
342342
const_format = "0.2.30"
343-
criterion = "0.5.1"
343+
criterion = { package = "codspeed-criterion-compat", version = "2.10.1" }
344344
crossbeam-channel = "0.5.8"
345345
dashmap = "6.1.0"
346346
data-encoding = "2.3.3"

turbopack/crates/turbo-tasks-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ proc-macro2 = { workspace = true }
1919
quote = { workspace = true }
2020
regex = { workspace = true }
2121
rustc-hash = { workspace = true }
22-
syn = { workspace = true, features = ["full", "extra-traits", "visit-mut"] }
22+
syn = { workspace = true, features = ["full", "extra-traits", "visit", "visit-mut"] }
2323
turbo-tasks-macros-shared = { workspace = true }

0 commit comments

Comments
 (0)