Before: entry.tsx imports @hermes/ink (394KB bundle) + App + GatewayClient in declaration order, then calls `gw.start()` at ~T=220ms. Python fork + server.py import starts then. After: only `GatewayClient` is statically imported (5ms, node builtins only). `gw.start()` fires at ~T=5ms. @hermes/ink + App load in parallel via `Promise.all(import(...))`. Python gets ~215ms of free runway to do its own module import before node even finishes loading. Net: session.info arrives ~150ms earlier in cold start. First React frame timing is unchanged (still ~240ms — still gated by ink+app imports). Removed a previously-tried warm-thread in server.py that pre-imported `run_agent` in the background. Measured variance showed occasional 5-10s outliers (GIL thrashing); median gain was <100ms. Not worth the non-determinism. |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| app | ||
| components | ||
| config | ||
| content | ||
| domain | ||
| hooks | ||
| lib | ||
| protocol | ||
| types | ||
| app.tsx | ||
| banner.ts | ||
| entry.tsx | ||
| gatewayClient.ts | ||
| gatewayTypes.ts | ||
| theme.ts | ||
| types.ts | ||