perf(cli): fast-path project start in production - #96
Merged
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a01745-c018-761f-86e0-66c4083a1dfd Co-authored-by: Upd4ting <upd4ting@gmail.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a01745-c018-761f-86e0-66c4083a1dfd Co-authored-by: Upd4ting <upd4ting@gmail.com>
Upd4ting
force-pushed
the
perf/production-launcher
branch
from
August 20, 2026 09:25
5d24a75 to
718d192
Compare
Co-authored-by: Upd4ting <upd4ting@gmail.com>
Co-authored-by: Upd4ting <upd4ting@gmail.com>
Co-authored-by: Upd4ting <upd4ting@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
None.
❓ Type of change
📚 Description
Make the existing public command
ajs project start [options]the lightweightproduction launcher. There is still exactly one package binary,
ajs:ajs project run/ajs project devkeep using the complete developer CLI;ajs project buildkeeps producing.antelope/build/build.json;ajs project startnow dispatches directly tolaunchFromBuild.The
ajsentry point is a small argument dispatcher. Only the canonicalproject startinvocation loads the nativenode:util.parseArgsstart path;every other command dynamically loads the unchanged Commander CLI, command
trees, scaffolding and npm update check. Shared project launch/shutdown behavior
was moved to a runtime module, while version checking, downloader
implementations, watch and REPL code are loaded only by development paths.
project startpreserves-p/--project,-e/--env,-c/--concurrency,--verbose,-h/--help, and the existing project/environment/verboseenvironment-variable fallbacks. No
ajs-startbinary or command is added.The branch remains based on
795dd1363d91549189bc2cc9f1e62d71155c8ab6and retains #97, #98, #100,#101 and #95.
Corrected cold-start benchmark
The previous benchmark's baseline was already
ajs project start(not a devcommand), but its candidate incorrectly used a separate
ajs-startbinary.This revision replaces that comparison. Both sides now execute the exact same
public command:
Method: same orb and representative two-local-module playground; production
artifact built in each worktree; Node.js 22.14.0 and pnpm 10.6.5; 15 fresh
processes per variant in strict baseline→candidate pairs (30 processes total).
A monotonic clock measured spawn to the first application lifecycle response
(
[module-b] Started). GNU time%Mmeasured maximum RSS. Quartiles use themedian-of-halves method. There were 0 errors.
main795dd1364edb705Exact measurement setup:
The harness selected each worktree's built
ajsentry through an isolatedPATH, timestamped immediately before spawn, and stopped the response timer atthe application marker while still waiting for clean process exit.
Packaged-consumer and hot-path verification
A final
pnpm packtarball was installed in a clean pnpm consumer. Verificationconfirmed:
{"ajs":"dist/core/cli/index.js"};.bin/ajsshim are executable;ajs project build -e productioncreates the real artifact;ajs project start -e productionreaches[module-b] Started.The real packaged start ran under a preload guard that throws if the process
loads Commander, the full CLI or command trees,
child_process, either versionchecker, downloader implementations, watch code, or REPL code. Startup passed,
proving that this hot path creates no package-manager subprocess and does not
load development/download command paths.
Validation
pnpm install --frozen-lockfile: passedpnpm run build: passedpnpm run test: passedpnpm run test:coverage: passed all 90% gatespnpm run lint: passed; only two pre-existing warnings and one pre-existing info remainLimits
module count.
dropped. Fixed baseline-first pair ordering may retain a small order effect.
start()hook, not an HTTP request measurement.memory; this may understate the baseline npm subprocess cost.
AntelopeJS runtime/logging stack. This PR does not refactor those contracts.
📝 Checklist
ajs module exports generateand committed any updated interface files. (Not applicable: no interface changes.)