Repository navigation
Commit e2e70bd
authored
perf: select project Node before installation (#202)
CI setup can install an extra Node.js LTS runtime before it selects the
project's requested version.
`setup-vp` now reads the selection before installation and passes it
through `VP_SETUP_NODE_VERSION` across GitHub Actions, GitLab, and
Azure. `node-version` takes precedence over `node-version-file`. Without
explicit inputs, discovery checks `.node-version`,
`package.json#devEngines.runtime`, `package.json#engines.node`, then
`.nvmrc` in each directory before its parent.
Compatible installers return the exact version for explicit `vp env use`
requests. Automatic discovery keeps its directory scope. With no
selection or with `node-manager: false`, the installer keeps its LTS
default. Older installers retain the existing behavior.
Runtime reuse requires a Vite+ release with [the installer
change](voidzero-dev/vite-plus#3087). The
installer itself does not discover project versions.
## Benchmark
Both cases use [Vite+ preview
`65f9bc5`](voidzero-dev/vite-plus@65f9bc5)
and project Node.js `22.23.1`. The control uses `setup-vp` at `ad00cb8`
with the default LTS installer runtime. The updated case uses `25c45da`
and passes the project version through `VP_SETUP_NODE_VERSION`.
The table shows median setup time from 12 samples per case on each OS,
across two workflow runs. Each installation uses fresh local runtime and
package caches. Installation order rotates between samples. Timing
covers `setup-vp` execution, including Node.js activation. It excludes
checkout and application dependency installation.
| Platform | Default LTS bootstrap | Project Node bootstrap | Time saved
| Reduction |
| --- | ---: | ---: | ---: | ---: |
| Linux x64 | 7.57 s | 5.80 s | 1.77 s | 23.4% |
| macOS ARM64 | 12.36 s | 7.91 s | 4.45 s | 36.0% |
| Windows x64 | 10.64 s | 9.24 s | 1.39 s | 13.1% |
Every optimized installation downloaded only project Node.js `22.23.1`.
Each control installation also downloaded LTS `24.22.0`. Network
variation affects individual measurements, especially on Windows; these
figures are observed median savings.
The workflow artifacts contain the raw timings and logs: [first
run](https://github.com/voidzero-dev/setup-vp/actions/runs/38926176533),
[second
run](https://github.com/voidzero-dev/setup-vp/actions/runs/38926725215).1 parent d5055d9 commit e2e70bd
24 files changed
Lines changed: 753 additions & 245 deletions
File tree
- dist
- azure
- gitlab
- src
- azure
- ci
- gitlab
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
356 | 358 | | |
357 | 359 | | |
358 | 360 | | |
| |||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
5 | 39 | | |
6 | 40 | | |
7 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 79 | + | |
87 | 80 | | |
88 | 81 | | |
89 | 82 | | |
90 | 83 | | |
91 | 84 | | |
92 | 85 | | |
93 | 86 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
0 commit comments