Repository navigation
perf(cli): reduce release binary size and compare preview artifacts - #3086
Conversation
a5def7e to
5156822
Compare
CLI artifact sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
packages/cli/dist |
Directory total | 2.11 MiB | 2.11 MiB | 0 B (0.00%) |
packages/core/dist |
Directory total | 4.08 MiB | 4.08 MiB | 0 B (0.00%) |
| Combined package dist | Directory total | 6.19 MiB | 6.19 MiB | 0 B (0.00%) |
vp (Linux x64) |
Binary | 10.25 MiB | 7.14 MiB | -3.11 MiB (-30.33%) |
vp (Linux x64) |
gzip -9 | 4.51 MiB | 3.32 MiB | -1.19 MiB (-26.36%) |
| NAPI (Linux x64) | Binary | 34.58 MiB | 34.58 MiB | 0 B (0.00%) |
| NAPI (Linux x64) | gzip -9 | 13.82 MiB | 13.82 MiB | 0 B (0.00%) |
vp (macOS ARM64) |
Binary | 7.65 MiB | 4.74 MiB | -2.91 MiB (-38.05%) |
vp (macOS ARM64) |
gzip -9 | 3.95 MiB | 2.84 MiB | -1.10 MiB (-27.96%) |
| NAPI (macOS ARM64) | Binary | 41.56 MiB | 41.56 MiB | 0 B (0.00%) |
| NAPI (macOS ARM64) | gzip -9 | 17.99 MiB | 17.99 MiB | 0 B (0.00%) |
vp (Windows x64) |
Binary | 8.33 MiB | 5.20 MiB | -3.13 MiB (-37.56%) |
vp (Windows x64) |
gzip -9 | 3.67 MiB | 2.44 MiB | -1.23 MiB (-33.56%) |
| NAPI (Windows x64) | Binary | 30.64 MiB | 30.64 MiB | 0 B (0.00%) |
| NAPI (Windows x64) | gzip -9 | 12.53 MiB | 12.53 MiB | -4 B (-0.00%) |
| Trampoline (Windows x64) | Binary | 13.50 KiB | 13.50 KiB | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 7.09 KiB | 7.09 KiB | 0 B (0.00%) |
| Installer (Windows x64) | Binary | 3.63 MiB | 3.63 MiB | -1.00 KiB (-0.03%) |
| Installer (Windows x64) | gzip -9 | 1.78 MiB | 1.78 MiB | -180 B (-0.01%) |
Registry bridge build (
|
| Package | Version |
|---|---|
vite-plus |
0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0 |
@voidzero-dev/vite-plus-core |
0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0 |
create-vite-plus |
0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0 |
Install the Vite+ CLI built from this commit, then migrate a project:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/voidzero-dev/vite-plus/a4e9c5932e069b5aea5b9c0136222ddada73bed0/packages/cli/install.sh | VP_PR_VERSION=3086 VP_LEGACY_INSTALLER_URL=https://raw.githubusercontent.com/voidzero-dev/vite-plus/a4e9c5932e069b5aea5b9c0136222ddada73bed0/packages/cli/install-legacy.sh bash# Windows (PowerShell)
$env:VP_PR_VERSION="3086"; $env:VP_LEGACY_INSTALLER_URL="https://raw.githubusercontent.com/voidzero-dev/vite-plus/a4e9c5932e069b5aea5b9c0136222ddada73bed0/packages/cli/install-legacy.ps1"; irm https://raw.githubusercontent.com/voidzero-dev/vite-plus/a4e9c5932e069b5aea5b9c0136222ddada73bed0/packages/cli/install.ps1 | iexOr download the standalone Windows installer built from this commit:
| Architecture | Installer |
|---|---|
| x64 | vp-setup-x86_64-pc-windows-msvc.exe |
| Arm64 | vp-setup-aarch64-pc-windows-msvc.exe |
GitHub requires you to sign in and downloads each installer as a ZIP artifact. Extract vp-setup.exe, then run it against this preview build:
.\vp-setup.exe --version "0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0" --registry "https://registry-bridge.viteplus.dev/"After installing, upgrade the current project's vite-plus to this test build with:
vp migrateOr create a new project from this commit without installing the CLI:
export npm_config_registry=https://registry-bridge.viteplus.dev/ pnpm_config_registry=https://registry-bridge.viteplus.dev/
pnpm create vite-plus@0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0 # or: npm create vite-plus@0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0$env:npm_config_registry="https://registry-bridge.viteplus.dev/"; $env:pnpm_config_registry="https://registry-bridge.viteplus.dev/"
pnpm create vite-plus@0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0 # or: npm create vite-plus@0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0pnpm 11+ reads pnpm_config_registry, npm and older pnpm read npm_config_registry. The new project pins this build, so keep the registry set for later installs, or configure it as below.
Or point your package manager at the bridge registry https://registry-bridge.viteplus.dev/:
| Package manager | Registry config |
|---|---|
| npm / pnpm / Bun | .npmrc: registry=https://registry-bridge.viteplus.dev/ |
| Yarn (v2+) | .yarnrc.yml: npmRegistryServer: "https://registry-bridge.viteplus.dev/" |
Then pin the build (vite aliases to vite-plus-core; pnpm can use a catalog, npm an overrides entry):
{
"devDependencies": {
"vite-plus": "0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0",
"vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.a4e9c5932e069b5aea5b9c0136222ddada73bed0"
}
}
🐳 Docker preview imageBuilt from this PR's registry bridge build:
# remove any stale local copy from a previous run, then pull fresh
docker rmi ghcr.io/voidzero-dev/vite-plus:pr-3086 2>/dev/null; docker pull ghcr.io/voidzero-dev/vite-plus:pr-3086Quick check: docker run --rm ghcr.io/voidzero-dev/vite-plus:pr-3086 vp --versionSee docs/guide/docker.md for usage. |
554d5cd to
6a10864
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
6a10864 to
723396f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a10864a16
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
93b8863 to
b3c1a08
Compare
This change reduces the standalone
vpexecutable size with a step-localCARGO_PROFILE_RELEASE_OPT_LEVEL=zoverride. Fat LTO remains enabled for both the standalone executable and the NAPI addon. The addon contains Rolldown and Oxc and keeps its existing release settings.vpexecutableopt-level=3,lto="fat"opt-level="z",lto="fat"opt-level=3,lto="fat"opt-level=3,lto="fat"On Apple M4 Max with macOS ARM64, the executable decreases from 7,991,312 to 4,954,496 bytes (38.0% smaller). The table compares standalone CLI commands from the same source commit,
a4e9c5932, with fat LTO in both builds. These CLI timings do not measure bundling. A separatevp buildcomparison below measures the bundled Rolldown.opt-level=3opt-level="z"vp -V, no local installationvp -V, local package and toolchain manifestvp env current node --jsonvp node -e ''vp env exec npm --versionvp env install 22.13.1, runtime absentThe version command adds 0.05–0.07 ms. Its measurements use 360 runs per binary per workload, in three rounds with randomized execution order. Environment commands add about 0.1–0.2 ms. Fresh Node.js installation adds 59 ms.
These measurements use warm filesystem caches. Installation uses a local mirror and includes signature verification, checksum verification, and extraction. Linux and Windows performance remains unmeasured.
The
vp buildcomparison uses the same native addon, Node.js22.23.2, Vite8.3.4, and Rolldown1.2.14for both variants. Fat LTO stays enabled. Each workload has 60 runs per variant in three rounds with balanced, randomized execution order.vp buildworkloadopt-level=3opt-level="z"threejs10x, 3,693 modulesThese workloads show no consistent slowdown. Differences change sign across rounds, and all 95% confidence intervals include zero. Timings include CLI startup, bundling, and output writes, with warm filesystem caches and no task cache. These results do not measure disabling fat LTO or changing the NAPI optimization level.
For comparison, the main Rust CLIs in uv and pnpm retain
opt-level=3. Both uselto="fat",codegen-units=1, symbol stripping, no debug information, andpanic="abort". uv usesopt-level="z"for its separateuv-buildbinary.uv's release workflow also uses profile-guided optimization on selected targets. Its macOS builds use LLD to merge identical code. pnpm's release workflow sets
-C force-unwind-tables=nofor the Linux CLI. Its NAPI addon keeps unwind tables and usespanic="unwind".The preview workflow adds a PR comment that compares each binary with the latest stable release. It shows raw sizes, gzip sizes, and changes for all eight targets, including Windows installers and trampolines.
The report uses code from the default branch and reads preview binaries without executing them. It updates the existing comment only while the PR still points to the built commit.