Repository navigation
Conversation
|
@rjmreis is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
|
Adds `tests/perf`, which bundles apps/tester-app in production mode (rspack and webpack, ios and android) for the current checkout and a base checkout, and compares the results: - output size (main bundle raw/gzip, all chunks, source maps, assets), module and chunk counts, and the list of emitted files; - build time (median of interleaved runs, each in a fresh process); - peak memory (process maxRSS plus the sampled process tree). Size metrics fail on a >1% increase. Time and memory use loose thresholds and only fail when head and base samples don't overlap. Metrics that vary between runs of one checkout (currently webpack output) are detected and compared like timings. Run locally with `pnpm bench --base-ref origin/main`. In CI, `.github/workflows/perf.yml` runs only on demand (the `perf` PR label or a manual dispatch) and is independent of the regular CI checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds two neutral apps that both Re.Pack and Metro build without changes: - apps/bench-expo: Expo Router app (Metro via Expo CLI, optionally with Expo's experimental tree shaking, vs Re.Pack with repack-expo); - apps/bench-bare: plain React Native app (Metro via the React Native CLI with @react-native/metro-config defaults, vs Re.Pack with the repack-init template config). `tests/perf/src/competitors.mjs` bundles each app at several sizes (screens added by `generate-screens.mjs`) and measures cold and warm release builds (wall time, CPU time, peak memory), bundle and Hermes bytecode size, and dev server startup and edit-to-bundle latency. It is not a regression gate: it is for comparing bundlers and finding performance wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38b8c3a to
8f5f58d
Compare
|
/review |
Apex SentinelVerdict: 1 finding(s): 1 minor. 🟡 Minor (1)
6 findings below Not in the reviewers' prompt (6 files)
Reviewed with this repository's own Sentinel configuration ( Feedback goes in the review comment threads, as a reply under the inline comment of a finding: Reply Useful? Reply Comment |
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 8f5f58d. The verdict and the full list are in the summary comment.
| function buildArgs(variant, outDir, cold) { | ||
| const { app, bundler } = VARIANTS[variant]; | ||
| const bundleOutput = path.join(outDir, 'main.jsbundle'); | ||
| if (bundler === 'expo') { | ||
| return [ | ||
| bin(app, 'expo'), | ||
| [ | ||
| 'export:embed', | ||
| '--platform', | ||
| platform, | ||
| '--dev', | ||
| 'false', | ||
| '--bundle-output', | ||
| bundleOutput, | ||
| '--sourcemap-output', | ||
| `${bundleOutput}.map`, | ||
| '--assets-dest', | ||
| path.join(outDir, 'assets'), | ||
| ...(cold ? ['--reset-cache'] : []), | ||
| ], | ||
| ]; | ||
| } | ||
| return [ | ||
| bin(app, 'react-native'), | ||
| [ | ||
| 'bundle', | ||
| '--platform', | ||
| platform, | ||
| '--dev', | ||
| 'false', | ||
| '--entry-file', | ||
| 'index.js', | ||
| '--bundle-output', | ||
| bundleOutput, | ||
| '--sourcemap-output', | ||
| `${bundleOutput}.map`, | ||
| '--assets-dest', | ||
| path.join(outDir, 'assets'), | ||
| ...(cold && bundler === 'metro' ? ['--reset-cache'] : []), | ||
| ], | ||
| ]; | ||
| } |
There was a problem hiding this comment.
🟡 Minor · bench-expo Repack bundle uses cwd entry index.js, which doesn't exist
Every expo-repack/expo-repack-cache variant fails because buildArgs passes index.js as --entry-file to Repack, but bench-expo has no index.js (its "main" is expo-router/entry). Repack throws Option '--entry-file <path>' argument is missing, so these variants can never produce the numbers the PR reports.
Suggested change
For the expo-repack variants, omit --entry-file to rely on the config/ExpoPlugin entry, or pass the expo-router entry. Also drop the unused --port arg from the bare-repack expo start command.
Details
persona: javascript
Why
To iterate on Re.Pack safely (including with AI-assisted changes), we need to know when a change makes bundle size, build time or memory worse. Then we can use the same tooling to find performance wins.
What's in it
Two commits:
1. Regression check:
tests/perfBundles
apps/tester-appin production mode (rspack + webpack, iOS + Android) for the branch and its base, and compares them.CI:
.github/workflows/perf.ymlis on-demand only and independent of the regular CI checks. It runs when a PR gets theperflabel, or from the Actions tab (optionally with a PR number). It writes a report to the job summary and is not a required check. The existing workflows are untouched.2. Competitor benchmark:
tests/perf/src/competitors.mjsTwo neutral apps that both bundlers build unchanged:
apps/bench-expo(Expo Router)repack-expoapps/bench-bare(plain RN)@react-native/metro-configdefaults)repack-inittemplate configEach app is measured at several sizes (screens generated by
generate-screens.mjs). The benchmark covers cold and warm release builds (wall time, CPU, peak memory), bundle and Hermes bytecode size, and dev server startup and edit-to-bundle latency.Early findings (leads, to confirm)
Measured before rebasing onto RN 0.88 / Expo 58, on an M4 Pro, iOS only:
thread-loader+babel-swc-loader: the same RN files get different@babel/runtimehelpers depending on the worker.More detail and pitfalls are in
agent_context/perf-regressions-oct2026/design.md.Notes for review
pnpm-lock.yamlalso bumps@babel/types7.29.7 → 7.29.8 in 5 existing entries. pnpm does this on any workspace change (it happens even when adding onlytests/perf, which has no dependencies), so it isn't something these apps need.perf.ymlhasn't run on GitHub yet; adding theperflabel to this PR will be its first real run.🤖 Generated with Claude Code