2026-02-27T12:57:56Z by Showboat 0.6.1
Two coordinated PRs optimize magellan compile --client in cpq-cds:
| PR | Repo | Branch | Changes |
|---|---|---|---|
| #109 | websmith | feature/transpile-module-fast-path |
transpileModule fast path + transpileOnly guards for declaration checks |
| #147 | qs-magellan | feature/disable-declarations-for-client |
needsTypeInfo = false on client addon + declaration: false in CLI client profile |
- Fast path infrastructure (commits
672d3de..c737617): Skipts.createProgram()when no addon needs type info and no declarations needed - transpileOnly declaration guard (commit
3fbf4e5):shouldUseTranspileModuleFastPath()returnstruewhentranspileOnlyis enabled even ifdeclaration: true— becausets.transpileModule()cannot produce.d.tsfiles - Per-file Program guard (commit
3fbf4e5):transpileSourceCode()skips per-file Program creation whentranspileOnlyis enabled
needsTypeInfo = falseonclient-function-transformaddon — opts the addon into the fast pathdeclaration: falsein CLI client profile builder — client proxies are runtime code, declarations not needed
- Baseline: 3 runs of
magellan compile --clientwith stock dependencies (magellan 0.19.2 + websmith 0.8.5) - Build & patch: Built websmith from PR branch, rebuilt magellan CLI webpack bundle with patched websmith + PR #147 changes
- Patched: 3 runs with combined changes
- Verified: Debug output confirms fast path activation
- Machine: MacBook Pro (Apple Silicon)
- Node.js: v25.6.1
- cpq-cds: 77 source files in
packages/service-proxies - Clean
lib/directory before each run
cpq-cds/packages/service-proxies
postinstall: magellan compile --client --addonsDir ./node_modules/@quatico/magellan-addons/lib
@quatico/magellan-cli@0.19.2 (webpack-bundled bin/magellan.js)
@quatico/websmith-core@0.8.5 <- patched
Note: magellan-cli bundles all dependencies into bin/magellan.js via webpack (~53K lines). Patching individual node_modules has no effect — the full CLI must be rebuilt.
Run 1: 90.18 real 113.66 user 14.79 sys
Run 2: 89.15 real 112.50 user 14.65 sys
Run 3: 88.88 real 110.30 user 14.78 sys
Avg: ~89.4s wall
Run 1: 0.89 real 1.50 user 0.11 sys
Run 2: 0.88 real 1.50 user 0.11 sys
Run 3: 0.88 real 1.50 user 0.11 sys
Avg: ~0.88s wall
| Metric | Baseline | Patched | Speedup |
|---|---|---|---|
| Avg wall time | 89.4s | 0.88s | 101x |
| Avg user time | 112.2s | 1.50s | 75x |
| Avg sys time | 14.7s | 0.11s | 134x |
Debug output confirms fast path activation:
[INFO] Using fast transpileModule path (no addons require type information, no declarations).
Output: 154 files (77 .js + 77 .js.map) in flat lib/ directory. No .d.ts files (expected — declaration: false in client profile). Output path structure differs from stock (flat vs nested) — this is expected behavior.
The optimization eliminates two expensive operations:
- Full Program creation (~40s):
ts.createProgram()builds the complete type graph for 77 source files + all transitive dependencies. With the fast path,program = undefined. - Per-file Program creation (~45s):
transpileSourceCode()was creating per-file Programs for declaration generation, even whentranspileOnlymode makes declarations impossible. Guard added:declaration && !this.transpileOnly.
What remains: ts.transpileModule() per file (~10ms each), addon processor execution, and result processing.
websmith test suite (after Compiler.ts changes):
@quatico/websmith-api — 6 suites, all passed
@quatico/websmith-core — 29 suites, all passed
@quatico/websmith-compiler — 2 suites, all passed
websmith-loader — 3 suites, all passed
@quatico/websmith-testing — 1 suite, all passed