Skip to content

perf(ci): use ThinLTO for native test builds - #3026

Merged
fengmk2 merged 3 commits into
mainfrom
perf/ci-native-thin-lto
Oct 14, 2026
Merged

fengmk2 merged 3 commits into
mainfrom
perf/ci-native-thin-lto

Conversation

@fengmk2

@fengmk2 fengmk2 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Native CI builds use fat LTO and one codegen unit. These settings increase compilation time for test binaries.

Define [profile.ci] in Cargo.toml with Oxc’s compilation settings: lto=thin, codegen-units=256, and opt-level=2. Select this profile in the CLI, ecosystem, documentation-format, and vp create build jobs. Keep the current panic, assertion, and overflow settings. Published binaries and the Windows trampoline retain their existing profiles.

Include the profile name in native and Cargo cache keys. Jobs that share caches select the same profile. Stage CI binaries in the existing artifact layout for test consumers.

This follows the compilation settings in Oxc’s coverage profile.

Compare main at e44387749 with this PR at c206ebe4c. Both variants use identical product source, runner profiles, and test commands. These results compare native build jobs, not total workflow duration.

Variant LTO Codegen units Optimization level
Main fat 1 3
This PR thin 256 2

Cold runs restore no workflow caches. They populate isolated caches for the next warm run; cold job times include cache writes. Warm runs require exact cache hits and do not save caches. Runner tool and checkout caches remain enabled for every variant. Each row contains one run per variant and excludes queue time. Job durations include setup and GitHub finalization. Temporary caches are removed after each cold/warm pair.

The first musl ci run compiled successfully, but two JavaScript type checks exceeded their 5-second timeout. That failed run is excluded from the timing tables. The retry uses unchanged source and timeouts, with its caches cleared.

Job Cache Main ThinLTO Change
Linux GNU Cold 8m34s 7m14s 🟢 ↓1m20s (15.6%)
Linux musl Cold 8m19s 7m27s 🟢 ↓52s (10.4%)
Windows cross-build Cold 17m18s 13m09s 🟢 ↓4m09s (24.0%)
macOS ARM64 Cold 8m56s 7m06s 🟢 ↓1m50s (20.5%)
Linux GNU Warm 57s 1m07s 🔴 ↑10s (17.5%)
Linux musl Warm 1m15s 1m30s 🔴 ↑15s (20.0%)
Windows cross-build Warm 12s 9s 🟢 ↓3s (25.0%)
macOS ARM64 Warm 3m03s 3m15s 🔴 ↑12s (6.6%)
vp create cache consumer Warm 51s 1m07s 🔴 ↑16s (31.4%)

Warm native cache hits skip native compilation. Differences between warm runs also include setup and execution variation.

Linux GNU warm steps took 54s on main and 52s with ci. GitHub finalization after the last step took 2s and 15s, respectively.

macOS ARM64 warm steps took 2m58s on main and 2m55s with ci. GitHub finalization after the last step took 4s and 21s, respectively.

Cargo reports the following native compilation times. These exclude cache transfers and include the Windows trampoline where applicable.

Platform Main ThinLTO Change
Linux GNU 7m22s 5m43s 🟢 ↓1m39s (22.4%)
Linux musl 7m03s 5m47s 🟢 ↓1m16s (18.0%)
Windows cross-build 8m07s 6m14s 🟢 ↓1m53s (23.2%)
macOS ARM64 5m59s 3m25s 🟢 ↓2m34s (42.9%)

Windows cold runs downloaded the MSVC SDK without an SDK cache. Downloads took 7m56s on main and 6m12s with ci. This network time affects the job comparison but is excluded from the Cargo times above.

Compressed Cargo cache sizes from the cold runs:

Platform Main ThinLTO Change
Linux GNU 624.3 MiB 640.4 MiB 🔴 ↑16.1 MiB (2.6%)
Linux musl 581.6 MiB 597.4 MiB 🔴 ↑15.8 MiB (2.7%)
macOS ARM64 640.3 MiB 658.0 MiB 🔴 ↑17.8 MiB (2.8%)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://perf-ci-native-thin-lto-viteplus-dev.voidzero-docs.workers.dev (commit 0bc83ea)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://63a266ee-viteplus-dev.voidzero-docs.workers.dev 0bc83ea 2026-10-14T11:03:41.131Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://edf9f32e-viteplus-dev.voidzero-docs.workers.dev c7f7d6e 2026-10-13T13:16:24.081Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://da1e126c-viteplus-dev.voidzero-docs.workers.dev bdf376b 2026-10-13T12:22:39.151Z Visit the dashboard ↗

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

CLI artifact sizes (0bc83ea)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.
The dist rows use the Linux build. The core total excludes .node files to match the release artifact.

Artifact Format Base PR Change
packages/cli/dist Directory total 2.21 MiB 2.21 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.29 MiB 6.29 MiB 0 B (0.00%)
vp (Linux x64) Binary 11.42 MiB 11.42 MiB 0 B (0.00%)
vp (Linux x64) gzip -9 4.94 MiB 4.94 MiB 0 B (0.00%)
NAPI (Linux x64) Binary 33.69 MiB 33.69 MiB 0 B (0.00%)
NAPI (Linux x64) gzip -9 13.41 MiB 13.41 MiB 0 B (0.00%)
vp (macOS ARM64) Binary 8.50 MiB 8.50 MiB 0 B (0.00%)
vp (macOS ARM64) gzip -9 4.31 MiB 4.31 MiB 0 B (0.00%)
NAPI (macOS ARM64) Binary 40.96 MiB 40.96 MiB 0 B (0.00%)
NAPI (macOS ARM64) gzip -9 17.64 MiB 17.64 MiB 0 B (0.00%)
vp (Windows x64) Binary 9.29 MiB 9.29 MiB 0 B (0.00%)
vp (Windows x64) gzip -9 4.05 MiB 4.05 MiB 0 B (0.00%)
NAPI (Windows x64) Binary 29.53 MiB 29.53 MiB 0 B (0.00%)
NAPI (Windows x64) gzip -9 12.03 MiB 12.03 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.08 KiB 7.08 KiB 0 B (0.00%)
Installer (Windows x64) Binary 4.63 MiB 4.63 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 2.17 MiB 2.17 MiB +2 B (+0.00%)

@fengmk2 fengmk2 self-assigned this Oct 13, 2026
@fengmk2
fengmk2 force-pushed the perf/ci-native-thin-lto branch from bdf376b to c7f7d6e Compare October 13, 2026 13:14
@fengmk2
fengmk2 marked this pull request as ready for review October 13, 2026 14:12
@fengmk2
fengmk2 requested a review from Brooooooklyn October 13, 2026 14:12
@fengmk2
fengmk2 merged commit 5b01b67 into main Oct 14, 2026
119 checks passed
@fengmk2
fengmk2 deleted the perf/ci-native-thin-lto branch October 14, 2026 11:14
@fengmk2 fengmk2 mentioned this pull request Oct 16, 2026
fengmk2 added a commit that referenced this pull request Oct 16, 2026
Vite+ 1.3 adds `create-vite-plus`, so `npm create vite-plus@latest`
starts a project without the global `vp`. It adds `vp pm pkg` for
editing `package.json` and `vp pm licenses list` for dependency
licenses, and lets `vp env` take package-manager dist-tags such as
`pnpm@latest-10`. It also makes `vp migrate` import rewriting much
faster on large projects and makes `vp dev` print Vite's `ready in` line
and honor `--debug`, `--filter`, and `--profile`.

### Features

- Create a Vite+ project without installing the global `vp` through
`pnpm create vite-plus`, `npm create vite-plus@latest`, `yarn create
vite-plus`, or `bun create vite-plus`, which run `vp create` with the
same arguments
([docs](https://viteplus.dev/guide/create#without-the-global-cli))
([#3028](#3028),
[#3048](#3048)), by
@liangmiQwQ.
- `vp pm pkg get`, `set`, `delete`, and `fix` read and update
`package.json` through the detected package manager: npm 7.20.0 and
later (`fix` from 9.8.0), pnpm 11.3.0 and later, and Bun 1.2.19 and
later
([docs](https://viteplus.dev/guide/package-management#package-manifest))
([#3020](#3020)), by
@jong-kyung.
- `vp pm licenses list` (or `ls`) lists dependency licenses through pnpm
7.17.0 and later, Yarn Classic, or Bun 1.4.0 and later, with `--json`
for machine-readable output
([#3037](#3037)), by
@jong-kyung.
- `vp env` accepts npm dist-tags in package-manager specs: `vp env pin
pnpm@latest-10` pins the exact version the tag points to, and `vp env
default pnpm@latest-10` follows the tag on each use
([#3047](#3047)), by
@liangmiQwQ.
- Upgrade the bundled tools
([#3058](#3058),
[#3078](#3078)), by
@voidzero-guard[bot] and @fengmk2:
- `rolldown@1.2.13` to `rolldown@1.2.14`. Rolldown adds the
`output.charset` option and fixes several tree-shaking, code-splitting,
and renaming bugs.
- `vitest@5.0.4` to `vitest@5.0.5`, with fixes for browser mode, hook
cleanup after a failing hook, and `--changed` with quoted file names.

### Fixes & Enhancements

- Import rewriting in `vp migrate` is up to 14 times faster on large
projects, for example 78 s to 5.6 s on Dify
([#2987](#2987)), by
@fengmk2.
- `vp dev` prints Vite's `ready in N ms` line, so scripts that wait for
it no longer time out after `vp migrate`. `--debug`, `--filter`, and
`--profile` now take effect in `vp dev`, `vp build`, and `vp preview`,
and `vp preview` stops when the build output is missing, as `vite
preview` does
([#3056](#3056)), by
@fengmk2.
- `vp staged` prints one result line per task, such as `✔ vp check
--fix`, instead of the task list and Git progress. Warnings, errors, and
rollback results stay visible, `--verbose` shows task output, and
`--debug` keeps the full log
([#3060](#3060)), by
@fengmk2.
- After a successful upgrade, `vp upgrade` reminds you to run `vp
migrate` in projects that use an older Vite+ version
([#3063](#3063)), by
@KTrain5169.
- The coding agent picker in `vp create` and `vp migrate` lists Claude
Code under `AGENTS.md` and no longer offers a separate `CLAUDE.md`
option. `--agent claude` and existing `CLAUDE.md` files still work
([#3055](#3055)), by
@fengmk2.

### Docs

- Recommend setting `runtimeOnFail: ignore` and `pmOnFail: ignore` in
the project's `pnpm-workspace.yaml` for pnpm 11 and later, since pnpm
does not read `runtimeOnFail` from its global config
([#3077](#3077)), by
@liangmiQwQ.

### Chore

- Speed up CI with ThinLTO native test builds, a pinned prepacked
Windows SDK, and a precompiled std for trampoline tests, keep
dependencies in Cargo caches, switch Linux runners, and update Windows
build pins with Renovate
([#3026](#3026),
[#2995](#2995),
[#3009](#3009),
[#3000](#3000),
[#3073](#3073),
[#3049](#3049)), by
@fengmk2.
- Stabilize CLI snapshots during slow package-manager downloads, isolate
Vitest browser and UI server ports, skip slow snapshot cases on Linux
and Windows, and remove duplicate Rust unit tests
([#3043](#3043),
[#3061](#3061),
[#3059](#3059),
[#3057](#3057)), by
@fengmk2 and @Brooooooklyn.
- Upgrade Rust crates and JavaScript dependencies, including
`rustls@0.23.46` and `ast-grep@0.51.0`, and remove unused catalog
entries ([#1780](#1780),
[#1782](#1782),
[#1783](#1783)), by
@renovate[bot] and @fengmk2.
- Refine the release-manager guidance
([#3052](#3052)), by
@fengmk2.

### Bundled Versions

| Tool | Version | Source | Changelog |
| --------------- | ---------- |
-------------------------------------------------------------------------------------------------
| ------------------------------------------------------------------- |
| vite | `8.3.4` |
[`b6c20f6`](vitejs/vite@b6c20f6)
| unchanged |
| rolldown | `1.2.14` |
[`c9a8cda`](rolldown/rolldown@c9a8cda)
| [1.2.14](https://github.com/rolldown/rolldown/releases/tag/v1.2.14) |
| tsdown | `0.23.1` | [npm](https://npmx.dev/package/tsdown/v/0.23.1) |
unchanged |
| vitest | `5.0.5` | [npm](https://npmx.dev/package/vitest/v/5.0.5) |
[5.0.5](https://github.com/vitest-dev/vitest/releases/tag/v5.0.5) |
| oxlint | `1.88.0` | [npm](https://npmx.dev/package/oxlint/v/1.88.0) |
unchanged |
| oxlint-tsgolint | `7.0.2004` |
[npm](https://npmx.dev/package/oxlint-tsgolint/v/7.0.2004) | unchanged |
| oxfmt | `0.73.0` | [npm](https://npmx.dev/package/oxfmt/v/0.73.0) |
unchanged |

### Upgrade

```bash
vp upgrade
```

**Full Changelog**:
v1.2.0...v1.3.0

---

Merging this PR will trigger the release workflow.

---------

Co-authored-by: voidzero-guard[bot] <278573678+voidzero-guard[bot]@users.noreply.github.com>
Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants