Files
orca/src/main/persistence
Neil 3e21f651d7 perf(orcad): overlap the profile writer thread and the daemon launch with startup (~45 ms off ready) (#185)
Three startup changes, each generic:
- orcad serve starts the profile store's writer thread before its preflight (~40 ms of thread and
  module startup), and the store adopts it. The thread waits for its initialization as its first
  message; an unclaimed thread is unref'd and discarded after 30 s, and a dead or mismatched one
  is replaced by a fresh spawn as before.
- Before the ~100 ms of synchronous module imports, orcad lets the terminal daemon's launch reach
  its fork (bounded at 50 ms), so the daemon boots alongside the imports instead of after them.
- The journal's storage-row schemas are built on first use. They cost ~15 ms to construct and
  nothing reads journal rows before ready (V8 coverage at ready: journalRowDeclaresMore count 0).

Measured on 4-vCPU VMs from the current golden, n=20 interleaved readyMs:
2.9 GHz host p50 617 -> 572, p95 662 -> 646; 2.5 GHz host p50 882 -> 834, p95 969 -> 905.
2026-11-09 23:45:33 -08:00
..