You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0bc95fc
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/operations/development.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,34 @@ To add a scenario, point a `SCENARIOS` entry at a generic ACP replay fixture
86
86
The agent replays session updates, permission requests, and questions. It drops session setup
87
87
and vendor frames, so Grok and fx recordings lose their vendor-only behavior.
88
88
89
+
### Profiling dev startup
90
+
91
+
Run `vp run profile:startup` to capture the first 20 seconds of inherited Node processes under
92
+
`.t3/startup-profiles/<timestamp>`. Workers that execute the preload get separate profiles.
93
+
It starts the normal dev runner and accepts its flags.
94
+
Stop it with Ctrl+C after the capture. Set `T3CODE_STARTUP_PROFILE_DIR` to choose another output
95
+
directory. Profiling adds overhead, so compare readiness with an ordinary `vp run dev` run.
96
+
97
+
Open a `.cpuprofile` in Chrome DevTools' Performance panel for sampled function stacks and source
98
+
lines. Each `.modules.json` is a Chrome trace containing timed module resolution, loading,
99
+
synchronous subprocess calls, and startup measures. Per-file records include importer URLs,
100
+
source loading, preparation, recursive dependency linking, and top-level evaluation. Preparation
101
+
uses synchronous loader boundaries; linking includes dependencies, and CommonJS evaluation can
102
+
include nested `require` calls. Some ESM/CommonJS interop reports a combined stage. `.process.json` records the process, Node version, and capture window.
103
+
The server's nested Effect and SQL spans remain in `.t3/userdata/logs/server.trace.ndjson`.
104
+
105
+
The preload temporarily adds module-body timing markers and uses one automatic debugger pause
106
+
to instrument the live Node loader. The launcher adds `--no-node-snapshot` to inherited
107
+
`NODE_OPTIONS` because Node 26's snapshotted loader cannot accept that breakpoint. Include the
108
+
same flag when using the preload directly. This disables Node's built-in startup snapshot,
109
+
can change compilation-cache hits, and adds overhead.
110
+
Treat per-file captures as diagnostic runs; use uninstrumented runs for baseline startup latency.
111
+
The first entry module can compile before loader instrumentation is installed.
112
+
113
+
A fresh process still uses filesystem, Node compilation, provider, and Vite dependency caches.
114
+
Measure a missing Vite dependency cache separately from a restart with an existing database.
115
+
Neither the Vite ready message nor the HTTP listener proves that a browser has rendered the app.
116
+
89
117
### Sharing and remote debugging
90
118
91
119
`vp run dev --share` publishes the web port over the machine's tailnet and prints a pairing URL
0 commit comments