Skip to content

Commit 9ce1dd3

Browse files
benchmarks: add five largest public monorepos to the nightly suite (#92)
* benchmarks: add five largest public monorepos to the nightly suite Pin microsoft/TypeScript, vercel/next.js, microsoft/vscode, storybookjs/storybook, and facebook/react by commit, record scan wall time and peak RSS offline, and publish the table from a nightly workflow. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: retrigger CI after workflow-change note fix Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c3ad95d commit 9ce1dd3

8 files changed

Lines changed: 633 additions & 2 deletions

File tree

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Large monorepos
2+
3+
# Observational nightly: check out the five pinned public monorepos, scan each offline,
4+
# and publish wall time and peak RSS to the job summary and an artifact. Not a required check.
5+
6+
on:
7+
schedule:
8+
# Nightly (after mutation at :47 past 4 UTC).
9+
- cron: "11 5 * * *"
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: large-monorepos-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: false
18+
19+
jobs:
20+
matrix:
21+
name: read suite pins
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
outputs:
25+
targets: ${{ steps.read.outputs.targets }}
26+
steps:
27+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
28+
with:
29+
persist-credentials: false
30+
- id: read
31+
name: Emit the suite matrix from benchmarks/large-monorepos.json
32+
run: |
33+
targets="$(jq -c '.repositories' benchmarks/large-monorepos.json)"
34+
count="$(jq '.repositories | length' benchmarks/large-monorepos.json)"
35+
if [ "$count" != "5" ]; then
36+
echo "::error::suite must list exactly five repositories (found $count)"
37+
exit 1
38+
fi
39+
echo "targets=$targets" >> "$GITHUB_OUTPUT"
40+
41+
measure:
42+
name: measure (${{ matrix.target.id }})
43+
needs: matrix
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 45
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
target: ${{ fromJson(needs.matrix.outputs.targets) }}
50+
steps:
51+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
52+
with:
53+
persist-credentials: false
54+
- uses: $/.github/actions/setup
55+
with:
56+
cache: npm
57+
- name: Build the large-monorepo harness
58+
run: npm run build --silent
59+
- name: Check out ${{ matrix.target.repository }} at the pinned commit
60+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
61+
with:
62+
repository: ${{ matrix.target.repository }}
63+
ref: ${{ matrix.target.commit }}
64+
path: targets/${{ matrix.target.id }}
65+
persist-credentials: false
66+
- name: Record scan time and peak memory
67+
run: |
68+
mkdir -p artifacts
69+
node dist/benchmarks/large-monorepos.js \
70+
--root targets \
71+
--only "${{ matrix.target.id }}" \
72+
--warmup 0 \
73+
--runs 1 \
74+
--json \
75+
--output "artifacts/${{ matrix.target.id }}.json"
76+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
77+
with:
78+
name: large-monorepo-${{ matrix.target.id }}
79+
path: artifacts/${{ matrix.target.id }}.json
80+
if-no-files-found: error
81+
retention-days: 14
82+
83+
publish:
84+
name: publish suite results
85+
needs: measure
86+
if: always() && needs.measure.result != 'cancelled'
87+
runs-on: ubuntu-latest
88+
timeout-minutes: 10
89+
steps:
90+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
91+
with:
92+
persist-credentials: false
93+
- uses: $/.github/actions/setup
94+
with:
95+
cache: npm
96+
- name: Build the merge helper
97+
run: npm run build --silent
98+
- name: Download per-repository measurements
99+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
100+
with:
101+
pattern: large-monorepo-*
102+
path: shard-results
103+
merge-multiple: true
104+
- name: Merge results into the job summary and artifact
105+
run: |
106+
mkdir -p artifacts
107+
node dist/benchmarks/large-monorepos.js \
108+
--merge shard-results \
109+
--output artifacts/large-monorepos.json \
110+
--summary "$GITHUB_STEP_SUMMARY"
111+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
112+
with:
113+
name: large-monorepos-${{ github.run_id }}
114+
path: artifacts/large-monorepos.json
115+
if-no-files-found: error
116+
retention-days: 30

‎benchmarks/large-monorepos.json‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"schemaVersion": "offing.large-monorepos.v1",
3+
"description": "The five largest public JS/TS monorepos that fit a nightly Actions checkout (by GitHub repository size), pinned by commit. Checkout happens in the workflow; scans stay offline.",
4+
"repositories": [
5+
{
6+
"id": "microsoft-typescript",
7+
"repository": "microsoft/TypeScript",
8+
"commit": "6bdcb54d23f41bc7098c1f3488ac599c75b852ca"
9+
},
10+
{
11+
"id": "vercel-next-js",
12+
"repository": "vercel/next.js",
13+
"commit": "8d1f4ed9c010edc763ee763942aac39b7d4ecfbd"
14+
},
15+
{
16+
"id": "microsoft-vscode",
17+
"repository": "microsoft/vscode",
18+
"commit": "ff9acdc74d3fbc338a6e50da2c31695eb0176a33"
19+
},
20+
{
21+
"id": "storybookjs-storybook",
22+
"repository": "storybookjs/storybook",
23+
"commit": "7c89155f3fae776c903876ecf9b2bc7b25c0f3a4"
24+
},
25+
{
26+
"id": "facebook-react",
27+
"repository": "facebook/react",
28+
"commit": "df6aa4ec76cff5b3adde531c6fe8c36099e0469b"
29+
}
30+
]
31+
}

0 commit comments

Comments
 (0)