-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
152 lines (148 loc) · 7.56 KB
/
perf-check.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
name: Performance Checks
on:
pull_request:
branches:
- main
- v4-main
types:
- labeled
- synchronize
- ready_for_review
env:
TURBO_API: http://127.0.0.1:9080
TURBO_TOKEN: this-is-not-a-secret
TURBO_TEAM: myself
concurrency:
group: perf-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
performance-checks:
if: contains(github.event.pull_request.labels.*.name, 'ci-perf')
name: 'Performance Checks'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 3
- run: git fetch origin main --depth=1
- name: Check SHA
run: |
sha=$(git rev-parse --short=8 HEAD)
echo "HEAD sha=$sha"
echo "GITHUB_SHA sha=$GITHUB_SHA"
mkdir -p tmp
echo $sha > tmp/sha-for-check.txt
originSha=$(git rev-parse HEAD^2)
echo $originSha > tmp/sha-for-commit.txt
git show --format=short --no-patch $originSha
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: 'package.json'
cache: 'pnpm'
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Get Browser Flags
id: browser-flags
run: |
BROWSER_FLAGS=$(node ./scripts/perf-tracking/browser-flags.mjs)
echo "BROWSER_FLAGS=$BROWSER_FLAGS" >> $GITHUB_OUTPUT
#env:
# DEBUG: true
- uses: tracerbench/tracerbench-compare-action@6b56fb774f78e4a85cf02396412b0164870cdab3
with:
experiment-build-command: pnpm --filter performance-test-app build --outDir dist-experiment
experiment-serve-command: pnpm --filter performance-test-app start dist-experiment -p 4201
control-build-command: pnpm --filter performance-test-app build --outDir dist-control
control-serve-command: pnpm --filter performance-test-app start dist-control -p 4200
control-sha: origin/main
sample-timeout: 60
use-pnpm: true
browser-args: ${{ steps.browser-flags.outputs.BROWSER_FLAGS }}
scenarios: |
{
"basic-record-materialization": {
"control": "http://localhost:4200/basic-record-materialization",
"experiment": "http://localhost:4201/basic-record-materialization",
"markers": "start-data-generation,start-push-payload,start-peek-records,start-record-materialization,end-record-materialization"
},
"complex-record-materialization": {
"control": "http://localhost:4200/complex-record-materialization",
"experiment": "http://localhost:4201/complex-record-materialization",
"markers": "start-data-generation,start-push-payload,start-peek-records,start-record-materialization,end-record-materialization"
},
"complex-record-materialization-with-relationship-materialization": {
"control": "http://localhost:4200/complex-record-materialization-with-relationship-materialization",
"experiment": "http://localhost:4201/complex-record-materialization-with-relationship-materialization",
"markers": "start-data-generation,start-push-payload,start-peek-records,start-record-materialization,start-field-access,start-relationship-access,end-relationship-access"
},
"relationship-materialization-simple": {
"control": "http://localhost:4200/relationship-materialization-simple",
"experiment": "http://localhost:4201/relationship-materialization-simple",
"markers": "start-find-all,start-materialization,end-materialization"
},
"relationship-materialization-complex": {
"control": "http://localhost:4200/relationship-materialization-complex",
"experiment": "http://localhost:4201/relationship-materialization-complex",
"markers": "start-data-generation,start-push-payload,start-peek-records,start-record-materialization,start-relationship-materialization,start-push-payload2,start-relationship-materialization2,end-relationship-materialization2"
},
"unload": {
"control": "http://localhost:4200/unload",
"experiment": "http://localhost:4201/unload",
"markers": "start-push-payload,start-unload-records,end-unload-records"
},
"unload-all": {
"control": "http://localhost:4200/unload-all",
"experiment": "http://localhost:4201/unload-all",
"markers": "start-push-payload,start-materialization,start-unload-all,end-unload-all"
},
"destroy": {
"control": "http://localhost:4200/destroy",
"experiment": "http://localhost:4201/destroy",
"markers": "start-push-payload,start-destroy-records,end-destroy-records"
},
"add-children": {
"control": "http://localhost:4200/add-children",
"experiment": "http://localhost:4201/add-children",
"markers": "start-push-initial-payload,start-push-update-payload,end-push-update-payload"
},
"unused-relationships": {
"control": "http://localhost:4200/unused-relationships",
"experiment": "http://localhost:4201/unused-relationships",
"markers": "start-push-payload,end-push-payload"
},
"update-with-same-state": {
"control": "http://localhost:4200/update-with-same-state",
"experiment": "http://localhost:4201/update-with-same-state",
"markers": "start-data-generation,start-push-initial-payload,start-peek-records,start-record-materialization,start-relationship-materialization,start-local-removal,start-push-minus-one-payload,start-local-addition,start-push-plus-one-payload,end-push-plus-one-payload"
},
"update-with-same-state-m2m": {
"control": "http://localhost:4200/update-with-same-state-m2m",
"experiment": "http://localhost:4201/update-with-same-state-m2m",
"markers": "start-data-generation,start-push-initial-payload,start-peek-records,start-record-materialization,start-relationship-materialization,start-local-removal,start-push-minus-one-payload,start-local-addition,start-push-plus-one-payload,end-push-plus-one-payload"
}
}
fidelity: 60
upload-traces: true
upload-results: true
# env:
# DEBUG: '*,-babel*,-vite*,-rollup*,-ember*,-broccoli*,-pnpm*,-embroider*,-tree-sync*,-fs-tree-diff*'
# - name: Upload Assets
# if: failure() || success()
# uses: actions/upload-artifact@v4
# with:
# name: built-files
# path: 'tests/performance/dist-*'
# retention-days: 1
- name: Report TracerBench Results
if: failure() || success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
COMMENT_MARKER="Performance Report for "
sha=$(cat tmp/sha-for-commit.txt)
node ./scripts/perf-tracking/create-comment.js $sha > tracerbench-results/comment.txt
COMMENT_TEXT="@./tracerbench-results/comment.txt"
source scripts/asset-size-tracking/src/post-comment.sh