Repository navigation
Description
Summary
The JS lint toolchain bootstrap (ci/setup-js-linting-fast.py) costs ~143s on a cold cache and re-pays that cost per-repo and per-worktree. This tracks the local fixes plus adoption of the global tool cache proposed in forge-ci/zccache#1469.
Measured breakdown
Warm steady-state JS linting is ~12s (ESLint 3.4s + tsc --noEmit 3.0s + overhead) — the linter itself is not the problem. The 143s is one-time setup:
| Stage | Measured |
|---|---|
| Node.js download (29.7 MB, single stream @ 2.1 MB/s) | 14.2s |
Zip extraction (2,134 files, Python zipfile) |
3.1s |
npm install (134 pkgs, cold cache) |
13.5s |
| Actual lint | 11.8s |
| Accounted | ~42s |
| Unexplained | ~100s |
The residual is most plausibly Windows Defender real-time scanning of the 5,483 newly-written files (85 MB Node + 47 MB node_modules), compounded by contention — that stage ran concurrently with three other lint stages. This is inference and has not been isolated.
Proposed work
1. Stop deleting the downloaded archive (small, immediate)
ci/setup-js-linting-fast.py:141 does download_path.unlink() after extracting. Any re-setup therefore re-downloads 29.7 MB. Retaining the archive makes re-setup nearly free.
2. Confirm and document the Defender cost (largest unknown)
Measure setup with .cache/ excluded from Windows Defender. If this accounts for the unexplained ~100s, document the exclusion as recommended developer setup. This is the single highest-value item and requires no code change.
3. Adopt zccache fetch once available (strategic)
Depends on forge-ci/zccache#1469. Replaces the bespoke httpx download + extract path in setup-js-linting-fast.py with a global content-addressed fetch, giving:
- Segmented download — measured 3.7x on this exact payload (14.2s → 3.9s with 8 connections, byte-identical).
nodejs.orgadvertisesAccept-Ranges: bytes. - Conditional-GET revalidation — measured 304 in 0.14s / 0 bytes vs 200 in 16.0s / 29.7 MB.
- Cross-repo and cross-worktree reuse — the toolchain stops being downloaded once per checkout.
- Integrity — the current path has no checksum verification; transport is the only guarantee.
Non-goals
Do not swap ESLint for Bun. Investigated and rejected on two independent grounds:
- Bun ships no linter. Bun implementing a Formatter and Linter oven-sh/bun#2246 ("Bun implementing a Formatter and Linter") has been open since March 2023 with no assignee and no linked PR.
- Bun is larger than Node:
bun-windows-x64.zipis 40.1 MB vs Node's 29.7 MB.
oxlint is viable but low-value. .cache/js-tools/.eslintrc.cjs already sets project: null (type-aware linting disabled), so every rule in use is syntactic and oxlint would be a near drop-in. But footprint is dominated by the Node runtime (85 MB) and typescript (23 MB), both of which stay because tsc does the type checking and needs Node. Net: 132 MB → ~108 MB, and ~3.3s off a 12s run. Cleanup, not a lever.
Scope caveat
All of the above optimizes a one-time cache miss. The recurring cost is the stop hook at ~7 minutes, dominated by uv run test.py --cpp. Two separate issues worth filing:
ci/hooks/check-on-stop.pyshould_skip_hook()fingerprintsgit status --porcelain, so any untracked file makes the hook run the full C++ suite on every stop.- The hook's working-directory resolution uses
cd "$(git rev-parse --show-superproject-working-tree || git rev-parse --show-toplevel || echo .)".--show-superproject-working-treeexits 0 with empty output outside a submodule, so||never advances to the fallback,cd ""is a silent no-op, and the hook resolvesci/hooks/against whatever cwd it inherited. It only works when cwd is already the repo root; any drift wedges every tool call.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Aug 22, 2026
Tracked in the meta issue: #3986 — remote assets: hosting, build-time resolution, and on-device filesystem deployment.
perf(ci): keep the Node.js archive so re-setup skips the download (#4001
test(ci): cover JS lint archive reuse
test(ci): cover JS lint archive reuse (#4089)
perf(ci): share JS lint tools across worktrees