Skip to content

Compile client/server/mcp in parallel with caching - #385

Draft
npapagna wants to merge 2 commits into
mainfrom
npapagna/faster-compile
Draft

Compile client/server/mcp in parallel with caching#385
npapagna wants to merge 2 commits into
mainfrom
npapagna/faster-compile

Conversation

@npapagna

@npapagna npapagna commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Cache tsc output across the four projects so incremental recompiles skip unchanged work (.tsbuildinfo under node_modules/.cache/tsc/).
  • Run client, client:bin, server, and mcp-server's tsc invocations concurrently instead of chained with &&.
  • Replace that hand-rolled parallel script with Lage: unchanged workspaces now skip invoking tsc entirely via a content-hash cache, and mcp-server's cross-package dependency on two client/src files is scoped so it no longer invalidates client's and server's caches too. compile:bin (CI-only helper-script type-check) stays out of Lage's task graph, running as a plain sequential step after.

Test plan

  • npm run lint && npm run format:check && npm run compile && npm test all pass locally
  • Verified no-op npm run compile drops to well under a second (Lage skip-cache)
  • Verified a real content change reruns only the affected workspace, others stay cached
  • Verified --continue still surfaces every project's compile errors, not just the first
  • CI (Health Check) passes on this PR

@npapagna
npapagna force-pushed the npapagna/faster-compile branch 2 times, most recently from eb9d51f to 5e3a251 Compare August 6, 2026 20:53
npm run compile ran a full, uncached type-check across all four
projects every time, even when only one file changed. Each tsconfig
now enables incremental compilation with a dedicated .tsbuildinfo
file under node_modules/.cache/tsc/, so tsc skips unchanged files on
repeat runs the same way lint and format already do.

A no-op or single-file recompile drops from about 9.4s to under 4s;
compile:clean forces a full re-check when the cache is suspected
stale.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@npapagna
npapagna force-pushed the npapagna/faster-compile branch from 5e3a251 to 8320e75 Compare August 7, 2026 11:22
npm run compile chained client, bin, server, and mcp through &&,
so they always ran one after another even though none of them
depend on each other's output. Each one still pays its own fixed
startup cost (loading the compiler, parsing tsconfig, checking its
.tsbuildinfo cache) on top of whatever it actually needs to
recheck, so a no-op compile paid that cost four times in a row for
no reason.

concurrently now runs all four at once, so the wall-clock time is
close to whatever the slowest one takes rather than the sum of all
four. Each tsc invocation still uses its own .tsbuildinfo cache
(from the previous commit) to skip files that haven't changed;
this just removes the artificial serialization on top of that.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@npapagna
npapagna force-pushed the npapagna/faster-compile branch from 8320e75 to 65ee5b8 Compare August 7, 2026 13:32
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.

1 participant