Skip to content

Commit 894d021

Browse files
committed
docs: improve SEA config comments with performance details and snapshot rationale
- Document useCodeCache provides ~13% faster startup (~22ms improvement) - Explain why useSnapshot is incompatible with socket-cli - socket-cli accesses ~70 env vars at module load time (HOME, SOCKET_CLI_API_TOKEN, etc.) - Snapshots would freeze build-time env values, breaking runtime configuration - Note that code cache + bundling provides ~25-30% startup improvement without restrictions This clarifies the performance strategy and why snapshots can't be used.
1 parent 263a990 commit 894d021

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/cli/scripts/sea-build-utils/builder.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ export async function generateSeaConfig(entryPoint, outputPath) {
6464
disableExperimentalSEAWarning: true,
6565
main: entryPoint,
6666
output: blobPath,
67-
// Enable code cache for optimization.
67+
// Enable code cache for ~13% faster startup (~22ms improvement).
68+
// Pre-compiles JavaScript code during build time for instant execution.
6869
useCodeCache: true,
69-
// Disable for compatibility.
70+
// Disable snapshots - incompatible with socket-cli's environment variable architecture.
71+
// socket-cli accesses ~70 env vars at module load time (HOME, SOCKET_CLI_API_TOKEN, etc.).
72+
// Snapshots would freeze build-time env values, breaking runtime configuration.
73+
// Code cache + bundling provides ~25-30% startup improvement without restrictions.
7074
useSnapshot: false,
7175
// Update configuration for built-in update checking.
7276
// The node-smol C stub will check for updates on exit and display notifications.

0 commit comments

Comments
 (0)