Skip to content

Commit 257b76c

Browse files
Added Generate Stats for MPA (#186)
1 parent 3fe1d03 commit 257b76c

19 files changed

Lines changed: 630 additions & 40 deletions

File tree

.github/frameworks.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"package": "app-astro",
3131
"buildScript": "build",
3232
"buildOutputDir": "dist",
33-
"measurements": [{ "type": "ssr" }, { "type": "spa" }]
33+
"measurements": [{ "type": "ssr" }, { "type": "spa" }, { "type": "mpa" }]
3434
}
3535
},
3636
{
@@ -74,7 +74,7 @@
7474
"package": "app-next-js",
7575
"buildScript": "build",
7676
"buildOutputDir": ".next",
77-
"measurements": [{ "type": "ssr" }, { "type": "spa" }]
77+
"measurements": [{ "type": "ssr" }, { "type": "spa" }, { "type": "mpa" }]
7878
}
7979
},
8080
{
@@ -96,7 +96,7 @@
9696
"package": "app-nuxt",
9797
"buildScript": "build",
9898
"buildOutputDir": ".output",
99-
"measurements": [{ "type": "ssr" }, { "type": "spa" }]
99+
"measurements": [{ "type": "ssr" }, { "type": "spa" }, { "type": "mpa" }]
100100
}
101101
},
102102
{
@@ -118,7 +118,7 @@
118118
"package": "app-react-router",
119119
"buildScript": "build",
120120
"buildOutputDir": "build",
121-
"measurements": [{ "type": "ssr" }, { "type": "spa" }]
121+
"measurements": [{ "type": "ssr" }, { "type": "spa" }, { "type": "mpa" }]
122122
}
123123
},
124124
{
@@ -140,7 +140,7 @@
140140
"package": "app-solid-start",
141141
"buildScript": "build",
142142
"buildOutputDir": ".output",
143-
"measurements": [{ "type": "ssr" }, { "type": "spa" }]
143+
"measurements": [{ "type": "ssr" }, { "type": "spa" }, { "type": "mpa" }]
144144
}
145145
},
146146
{
@@ -162,7 +162,7 @@
162162
"package": "app-sveltekit",
163163
"buildScript": "build",
164164
"buildOutputDir": "build",
165-
"measurements": [{ "type": "ssr" }, { "type": "spa" }]
165+
"measurements": [{ "type": "ssr" }, { "type": "spa" }, { "type": "mpa" }]
166166
}
167167
},
168168
{
@@ -184,7 +184,7 @@
184184
"package": "app-tanstack-start-react",
185185
"buildScript": "build",
186186
"buildOutputDir": ".output",
187-
"measurements": [{ "type": "ssr" }, { "type": "spa" }]
187+
"measurements": [{ "type": "ssr" }, { "type": "spa" }, { "type": "mpa" }]
188188
}
189189
}
190190
]

.github/workflows/generate-stats.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
ssr-matrix: ${{ steps.set-matrix.outputs.ssr }}
2828
deps-matrix: ${{ steps.set-matrix.outputs.deps }}
2929
spa-matrix: ${{ steps.set-matrix.outputs.spa }}
30+
mpa-matrix: ${{ steps.set-matrix.outputs.mpa }}
3031
steps:
3132
- name: Checkout code
3233
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -40,6 +41,7 @@ jobs:
4041
echo "ssr=$(echo "$FRAMEWORKS" | jq -c '[.[] | select(.app) | select(.app.measurements | map(.type) | contains(["ssr"])) | {name, displayName, package: .app.package, buildScript: .app.buildScript, buildOutputDir: .app.buildOutputDir, measurements: .app.measurements}]')" >> $GITHUB_OUTPUT
4142
echo "deps=$(echo "$FRAMEWORKS" | jq -c '[.[] | select(.starter) | select(.starter.measurements | map(.type) | contains(["dependencies"])) | {name, displayName, package: .starter.package}]')" >> $GITHUB_OUTPUT
4243
echo "spa=$(echo "$FRAMEWORKS" | jq -c '[.[] | select(.app) | select(.app.measurements | map(.type) | contains(["spa"])) | {name, displayName, package: .app.package, buildScript: .app.buildScript, buildOutputDir: .app.buildOutputDir, measurements: .app.measurements}]')" >> $GITHUB_OUTPUT
44+
echo "mpa=$(echo "$FRAMEWORKS" | jq -c '[.[] | select(.app) | select(.app.measurements | map(.type) | contains(["mpa"])) | {name, displayName, package: .app.package, buildScript: .app.buildScript, buildOutputDir: .app.buildOutputDir, measurements: .app.measurements}]')" >> $GITHUB_OUTPUT
4345
4446
measure:
4547
needs: setup
@@ -50,6 +52,7 @@ jobs:
5052
ssr-matrix: ${{ needs.setup.outputs.ssr-matrix }}
5153
deps-matrix: ${{ needs.setup.outputs.deps-matrix }}
5254
spa-matrix: ${{ needs.setup.outputs.spa-matrix }}
55+
mpa-matrix: ${{ needs.setup.outputs.mpa-matrix }}
5356

5457
generate-stats:
5558
needs: [setup, measure]

.github/workflows/measure-framework.yml

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ on:
2525
type: string
2626
required: false
2727
default: '[]'
28+
mpa-matrix:
29+
description: 'JSON array of frameworks to measure MPA paint and interaction performance'
30+
type: string
31+
required: false
32+
default: '[]'
2833

2934
jobs:
3035
measure-install:
@@ -205,13 +210,13 @@ jobs:
205210
framework: ${{ fromJson(inputs.spa-matrix) }}
206211
steps:
207212
- name: Checkout code
208-
uses: actions/checkout@v4
213+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
209214

210215
- name: Setup pnpm
211-
uses: pnpm/action-setup@v4
216+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
212217

213218
- name: Setup Node.js
214-
uses: actions/setup-node@v4
219+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
215220
with:
216221
node-version: '24'
217222
cache: 'pnpm'
@@ -243,3 +248,52 @@ jobs:
243248
path: packages/${{ matrix.framework.package }}/ci-stats.json
244249
retention-days: 1
245250
if-no-files-found: error
251+
252+
measure-mpa:
253+
if: inputs.mpa-matrix != '[]'
254+
runs-on: ubuntu-latest
255+
container:
256+
image: mcr.microsoft.com/playwright:v1.49.0-noble
257+
options: --ipc=host
258+
strategy:
259+
fail-fast: false
260+
matrix:
261+
framework: ${{ fromJson(inputs.mpa-matrix) }}
262+
steps:
263+
- name: Checkout code
264+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
265+
266+
- name: Setup pnpm
267+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
268+
269+
- name: Setup Node.js
270+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
271+
with:
272+
node-version: '24'
273+
cache: 'pnpm'
274+
275+
- name: Install workspace dependencies
276+
run: pnpm install --frozen-lockfile
277+
278+
- name: Install package dependencies
279+
working-directory: ./packages/${{ matrix.framework.package }}
280+
run: pnpm install --frozen-lockfile --ignore-workspace
281+
282+
- name: Build app
283+
working-directory: ./packages/${{ matrix.framework.package }}
284+
run: pnpm build
285+
286+
- name: Run MPA benchmark
287+
run: pnpm --filter @framework-tracker/stats-generator run:mpa ${{ matrix.framework.package }}
288+
env:
289+
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
290+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
291+
RUNNER_LABEL: ubuntu-latest
292+
293+
- name: Upload MPA stats
294+
uses: actions/upload-artifact@v4
295+
with:
296+
name: mpa-stats-${{ matrix.framework.name }}
297+
path: packages/${{ matrix.framework.package }}/ci-stats.json
298+
retention-days: 1
299+
if-no-files-found: error

.github/workflows/validate-stats.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,28 @@ jobs:
7272
(cd packages/$PKG && npx @e18e/cli@0.5.0 analyze --json > e18e-stats.json || true)
7373
done
7474
75+
echo ""
76+
echo "=== Running SPA benchmarks ==="
77+
FRAMEWORKS=$(cat .github/frameworks.json)
78+
echo "$FRAMEWORKS" | jq -c '.[] | select(.starter) | select(.starter.measurements | map(.type) | contains(["spa"]))' | while read -r framework; do
79+
PKG=$(echo "$framework" | jq -r '.starter.package')
80+
echo "Building SPA for $PKG..."
81+
(cd packages/$PKG && pnpm build)
82+
echo "Running SPA benchmark for $PKG..."
83+
pnpm --filter @framework-tracker/stats-generator run:spa $PKG
84+
done
85+
86+
echo ""
87+
echo "=== Running MPA benchmarks ==="
88+
FRAMEWORKS=$(cat .github/frameworks.json)
89+
echo "$FRAMEWORKS" | jq -c '.[] | select(.app) | select(.app.measurements | map(.type) | contains(["mpa"]))' | while read -r framework; do
90+
PKG=$(echo "$framework" | jq -r '.app.package')
91+
echo "Building MPA for $PKG..."
92+
(cd packages/$PKG && pnpm build)
93+
echo "Running MPA benchmark for $PKG..."
94+
pnpm --filter @framework-tracker/stats-generator run:mpa $PKG
95+
done
96+
7597
echo ""
7698
echo "=== Validating all outputs ==="
7799
pnpm --filter @framework-tracker/stats-generator validate

packages/app-astro/ci-stats.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2-
"timingMeasuredAt": "2026-03-08T00:31:57.171Z",
3-
"runner": "ubuntu-latest",
2+
"timingMeasuredAt": "2026-04-21T05:06:35.326Z",
3+
"runner": "local",
44
"frameworkVersion": "5.16.15",
55
"ssrOpsPerSec": 366,
66
"ssrAvgLatencyMs": 2.735,
77
"ssrSamples": 3656,
88
"ssrBodySizeKb": 99.86,
9-
"ssrDuplicationFactor": 1
9+
"ssrDuplicationFactor": 1,
10+
"mpaFirstPaintMs": 90.33,
11+
"mpaFCPMs": 90.39,
12+
"mpaINPMs": 22.56,
13+
"mpaRuns": 3
1014
}

packages/app-next-js/ci-stats.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"timingMeasuredAt": "2026-04-05T04:53:54.987Z",
2+
"timingMeasuredAt": "2026-04-21T05:07:39.298Z",
33
"runner": "local",
44
"frameworkVersion": "16.1.1",
55
"ssrOpsPerSec": 129,
@@ -10,5 +10,9 @@
1010
"spaFirstPaintMs": 371,
1111
"spaFCPMs": 370.94,
1212
"spaINPMs": 23.38,
13-
"spaRuns": 1
13+
"spaRuns": 1,
14+
"mpaFirstPaintMs": 127.33,
15+
"mpaFCPMs": 127.19,
16+
"mpaINPMs": 20.21,
17+
"mpaRuns": 3
1418
}

packages/app-nuxt/ci-stats.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
{
2-
"timingMeasuredAt": "2026-03-08T00:31:57.171Z",
3-
"runner": "ubuntu-latest",
2+
"timingMeasuredAt": "2026-04-21T05:26:28.141Z",
3+
"runner": "local",
44
"frameworkVersion": "4.2.2",
55
"ssrOpsPerSec": 248,
66
"ssrAvgLatencyMs": 4.037,
77
"ssrSamples": 2478,
88
"ssrBodySizeKb": 201.18,
9-
"ssrDuplicationFactor": 2
9+
"ssrDuplicationFactor": 2,
10+
"mpaFirstPaintMs": 89.67,
11+
"mpaFCPMs": 89.6,
12+
"mpaINPMs": 24.05,
13+
"mpaRuns": 3,
14+
"spaFirstPaintMs": 111.67,
15+
"spaFCPMs": 111.7,
16+
"spaINPMs": 22.65,
17+
"spaRuns": 3
1018
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
{
2-
"timingMeasuredAt": "2026-03-08T00:31:57.171Z",
3-
"runner": "ubuntu-latest",
2+
"timingMeasuredAt": "2026-04-21T05:29:46.068Z",
3+
"runner": "local",
44
"frameworkVersion": "7.10.1",
55
"ssrOpsPerSec": 64,
66
"ssrAvgLatencyMs": 15.528,
77
"ssrSamples": 644,
88
"ssrBodySizeKb": 211.14,
9-
"ssrDuplicationFactor": 2
9+
"ssrDuplicationFactor": 2,
10+
"mpaFirstPaintMs": 167.33,
11+
"mpaFCPMs": 167.24,
12+
"mpaINPMs": 24.37,
13+
"mpaRuns": 3,
14+
"spaFirstPaintMs": 121,
15+
"spaFCPMs": 121.16,
16+
"spaINPMs": 22.24,
17+
"spaRuns": 3
1018
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
{
2-
"timingMeasuredAt": "2026-03-08T00:31:57.171Z",
3-
"runner": "ubuntu-latest",
2+
"timingMeasuredAt": "2026-04-21T05:30:50.803Z",
3+
"runner": "local",
44
"frameworkVersion": "1.2.1",
55
"ssrOpsPerSec": 234,
66
"ssrAvgLatencyMs": 4.275,
77
"ssrSamples": 2340,
88
"ssrBodySizeKb": 225.49,
9-
"ssrDuplicationFactor": 2
9+
"ssrDuplicationFactor": 2,
10+
"mpaFirstPaintMs": 106.33,
11+
"mpaFCPMs": 106.31,
12+
"mpaINPMs": 23.79,
13+
"mpaRuns": 3,
14+
"spaFirstPaintMs": 114,
15+
"spaFCPMs": 114.32,
16+
"spaINPMs": 21.33,
17+
"spaRuns": 3
1018
}

packages/app-sveltekit/ci-stats.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"timingMeasuredAt": "2026-04-05T04:55:06.141Z",
2+
"timingMeasuredAt": "2026-04-21T05:11:57.395Z",
33
"runner": "local",
44
"frameworkVersion": "2.49.4",
55
"ssrOpsPerSec": 259,
@@ -10,5 +10,9 @@
1010
"spaFirstPaintMs": 93,
1111
"spaFCPMs": 93.14,
1212
"spaINPMs": 20.37,
13-
"spaRuns": 1
13+
"spaRuns": 1,
14+
"mpaFirstPaintMs": 109,
15+
"mpaFCPMs": 108.78,
16+
"mpaINPMs": 21.66,
17+
"mpaRuns": 3
1418
}

0 commit comments

Comments
 (0)