perf: reduce vp binary size#2043
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
Native binary sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
vp (Linux x64) |
Binary | 11,289,264 B (10.77 MiB) | 10,759,288 B (10.26 MiB) | -529,976 B (-4.69%) |
vp (Linux x64) |
gzip -9 | 4,765,238 B (4.54 MiB) | 4,492,853 B (4.28 MiB) | -272,385 B (-5.72%) |
| NAPI (Linux x64) | Binary | 35,226,448 B (33.59 MiB) | 35,063,504 B (33.44 MiB) | -162,944 B (-0.46%) |
| NAPI (Linux x64) | gzip -9 | 13,162,726 B (12.55 MiB) | 13,090,179 B (12.48 MiB) | -72,547 B (-0.55%) |
| Trampoline (Windows x64) | Binary | 207,872 B (0.20 MiB) | 207,872 B (0.20 MiB) | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 97,498 B (0.09 MiB) | 97,497 B (0.09 MiB) | -1 B (-0.00%) |
87be261 to
49eecdc
Compare
49eecdc to
ad948a7
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad948a7d08
ℹ️ 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".
| - 'crates/**' | ||
| - 'Cargo.lock' | ||
| - 'Cargo.toml' | ||
| - 'rust-toolchain.toml' |
There was a problem hiding this comment.
Include all native build inputs in the trigger
This path filter watches crates/** and Cargo files, but the workflow also builds the NAPI crate from packages/cli/binding (cargo build -p vite-plus-cli) and the clone action reads packages/tools/.upstream-versions.json to choose the rolldown/vite revisions. A PR that changes either of those inputs can change the measured native artifacts without running this workflow at all, so the size report silently misses those regressions; add those paths to the filter or remove the filter.
Useful? React with 👍 / 👎.
| comment: | ||
| name: Report binary size | ||
| needs: [base, head] | ||
| if: github.event.pull_request.head.repo.full_name == github.repository |
There was a problem hiding this comment.
Avoid building fork PRs without reporting the result
When the PR comes from a fork, this job is skipped, but the base and head jobs above are not gated the same way. Since this skipped job is also the only place the comparison is emitted, including the job summary, fork PRs still spend CI time on both release builds and then produce no size output; either skip the build jobs for forks too or keep a read-only summary/report path for them.
Useful? React with 👍 / 👎.
Summary
tracing-subscriberto thefmtandstdfeatures used by the native binarieszipto Deflate support required by official Node.js Windows archivesvite_errorvp, NAPI, and trampoline release artifacts and maintains a sticky PR comment with raw andgzip -9sizesLocal size comparison
macOS ARM64 release builds:
vpvp(gzip -9)gzip -9)The workflow adds the authoritative Linux x64
vp/NAPI and Windows x64 trampoline comparison below. No optimization level or runtime behavior was changed.Validation
cargo shearjust checkjust lintcargo test -p vite_migration(312 passed)env -u NODE_OPTIONS cargo test -p vite_js_runtime --lib(119 passed, 2 ignored, including live Node download/extraction)cargo build -p vite_global_cli --releasepnpm --filter=vite-plus build-native --target aarch64-apple-darwin --skip-formattarget/release/vp --helptarget/release/vp --versioncargo fmt --all --checkactionlint .github/workflows/vp-binary-size.yml