10000 chore(ci): Configure small benchmark for builds (#79796) · vercel/next.js@cc3c42f · GitHub
[go: up one dir, main page]

Skip to content

Commit cc3c42f

Browse files
authored
chore(ci): Configure small benchmark for builds (#79796)
### What? We can use codspeed for profiling the build performance, considering that these apps are very small. ### Why? We need an e2e benchmark.
1 parent 6c7a69a commit cc3c42f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3654
-14
lines changed

.github/workflows/test-turbopack-rust-bench-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ jobs:
4242
check-latest: true
4343
- run: corepack enable
4444

45+
# We need to install the dependencies for the benchmark apps
46+
- run: pnpm install
47+
working-directory: turbopack/benchmark-apps
48+
4549
- name: Build benchmarks for tests
4650
timeout-minutes: 120
4751
run: |

.github/workflows/turbopack-benchmark.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ env:
2525
CARGO_INCREMENTAL: 0
2626
# For faster CI
2727
RUST_LOG: 'off'
28+
TURBO_TEAM: 'vercel'
29+ TURBO_CACHE: 'remote:rw'
30+
TURBO_TOKEN: ${{ secrets.HOSTED_TURBO_TOKEN }}
2831

2932
jobs:
30-
benchmark-small:
31-
name: Benchmark Rust Crates (small)
33+
benchmark-tiny:
34+
name: Benchmark Rust Crates (tiny)
3235
runs-on: ubuntu-22.04
3336
steps:
3437
- uses: actions/checkout@v4
@@ -50,6 +53,43 @@ jobs:
5053
run: cargo codspeed run
5154
token: ${{ secrets.CODSPEED_TOKEN }}
5255

56+
benchmark-small-apps:
57+
name: Benchmark Rust Crates (small apps)
58+
runs-on: ubuntu-22.04
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Setup Rust toolchain
63+
uses: ./.github/actions/setup-rust
64+
65+
- name: Install cargo-codspeed
66+
uses: taiki-e/install-action@v2
67+
with:
68+
tool: cargo-codspeed@2.10.1
69+
70+
- name: Cache on ${{ github.ref_name }}
71+
uses: ijjk/rust-cache@turbo-cache-v1.0.8
72+
with:
73+
save-if: 'true'
74+
cache-provider: 'turbo'
75+
shared-key: build-turbopack-benchmark-small-apps-${{ hashFiles('.cargo/config.toml') }}
76+
77+
- name: Install pnpm dependencies
78+
working-directory: turbopack/benchmark-apps
79+
run: |
80+
npm i -g corepack@0.31
81+
corepack enable
82+
pnpm install --loglevel error
83+
84+
- name: Build app build benchmarks
85+
run: cargo codspeed build -p turbopack-cli small_apps
86+
87+
- name: Run the benchmarks
88+
uses: CodSpeedHQ/action@v3
89+
with:
90+
run: cargo codspeed run
91+
token: ${{ secrets.CODSPEED_TOKEN }}
92+
5393
benchmark-large:
5494
name: Benchmark Rust Crates (large)
5595
# If the task is triggered manually, we want to run the large benchmarks

turbopack/benchmark-apps/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Benchmark Apps
2+
3+
This directory contains apps that are used to benchmark the performance of Turbopack.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as React from 'react'
2+
import * as DateFns from 'date-fns'
3+
4+
console.log(DateFns)
5+
6+
export default function Home() {
7+
return <div>Benchmark</div>
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-mui/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import App from './App'
4+
5+
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
<React.StrictMode>
7+
<App />
8+
</React.StrictMode>
9+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import * as React from 'react'
2+
import { format } from 'date-fns'
3+
4+
export default function Home() {
5+
return <div>{format(new Date(), "'Today is a' eeee")}</div>
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-mui/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import App from './App'
4+
5+
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
<React.StrictMode>
7+
<App />
8+
</React.StrictMode>
9+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* eslint-disable react/jsx-pascal-case */
2+
import * as React from 'react'
3+
import * as FramerMotion from 'framer-motion'
4+
5+
console.log(FramerMotion)
6+
7+
export default function Home() {
8+
return (
9+
<div>
10+
<FramerMotion.motion.div animate={{ x: 0 }} />
11+
</div>
12+
)
13+
}

0 commit comments

Comments
 (0)
0