forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (133 loc) · 4.98 KB
/
bench-turbopack-scheduled.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Benchmark other Bundlers
on:
schedule:
# Run every week on Sunday 12:42
- cron: "42 12 * * 0"
workflow_dispatch:
env:
NODE_OPTIONS: "--max-old-space-size=32768"
jobs:
bench:
strategy:
fail-fast: false
matrix:
bench:
# One of Turbopack CSR or SSR with 1000 modules is benchmarked in every run
# to create a baseline result for normalization (should the runners performance vary between jobs)
# This measures Next.js canary
- name: Next canary turbo
title: Next.js canary Turbo
run_args: '"(Turbopack SSR/1000|Next.js canary Turbo)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Next.js 13
- name: next 13 turbo
title: Next.js 13 Turbo
run_args: '"(Turbopack SSR/1000|Next.js 13 Turbo)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Next.js canary
- name: next canary
title: Next.js canary
run_args: '"(Turbopack SSR/1000|Next.js canary webpack)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Next.js 13
- name: next 13
title: Next.js 13
run_args: '"(Turbopack SSR/1000|Next.js 13 webpack)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Next.js 12
- name: next 12
title: Next.js 12
run_args: '"(Turbopack SSR/1000|Next.js 12)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Next.js 11
- name: next 11
title: Next.js 11
run_args: '"(Turbopack SSR/1000|Next.js 11)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Vite
- name: vite
title: Vite
run_args: '"(Turbopack CSR/1000|Vite)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Parcel
- name: parcel
title: Parcel
run_args: '"(Turbopack CSR/1000|Parcel)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Webpack
- name: webpack
title: Webpack
run_args: '"(Turbopack CSR/1000|Webpack)"'
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
runs-on: ubuntu-latest-8-core-oss
name: Bench - ${{ matrix.bench.title }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-rust
with:
shared-cache-key: benchmark-bundlers
- name: Clear potentially cached benchmarks
run: rm -rf target/criterion
- name: Build benchmarks
timeout-minutes: 120
run: cargo bench --no-run -p turbopack-bench -p turbopack-cli
- name: Run cargo bench
timeout-minutes: 180
env:
TURBOPACK_BENCH_BUNDLERS: ${{ matrix.bench.TURBOPACK_BENCH_BUNDLERS }}
TURBOPACK_BENCH_COUNTS: ${{ matrix.bench.TURBOPACK_BENCH_COUNTS }}
run: cargo bench -p turbopack-bench -p turbopack-cli -- ${{ matrix.bench.run_args }}
- name: Install critcmp
if: always()
uses: baptiste0928/cargo-install@v1
with:
crate: critcmp
- name: Compare results
if: always()
run: critcmp --group "([^/]+/)[^/]+(?:/)(.+)" base
- name: Export results
if: always()
run: critcmp --export base > raw.json
- name: Upload results
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.bench.name }}
path: raw.json
commit_results:
name: Commit benchmark-data
needs: bench
if: always()
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: |
echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT
echo "month=$(date +'%m')" >> $GITHUB_OUTPUT
echo "date=$(date +'%s')" >> $GITHUB_OUTPUT
echo "pretty=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_OUTPUT
- name: Checkout benchmark-data
uses: actions/checkout@v3
with:
ref: benchmark-data
- name: Download benchmark data
uses: actions/download-artifact@v3
with:
path: data/${{ steps.date.outputs.year }}/${{ steps.date.outputs.month }}/ubuntu-latest-8-core/${{ steps.date.outputs.date }}-${{ github.sha }}
- name: Git pull
run: git pull --depth=1 --no-tags origin benchmark-data
- name: Push data to branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Benchmark result for ${{ steps.date.outputs.pretty }} (${{ github.sha }})