Counterintuitive fix on Linux: an extra exec makes spawning faster
charliermarsh · x · 2026-11-25
When setup isn't supported by posixspawn, Codex's Linux approach is: use posixspawn to spawn itself, do the setup in the new process, then exec the target command — counterintuitively adding an extra exec to make the whole thing faster.
More from coding & agent
- Next.js Nights Berlin on Dec 2 to cover Go support, native routes, and agent-ready framework — evilrabbit_ · 2026-11-25
- OpenAI open-sources fix for Codex MCP server spawning reliability on macOS — charliermarsh · 2026-11-25
- Codex built its own Rust Command abstraction to stay on posix_spawn — charliermarsh · 2026-11-25
- Rust's std usually uses posix_spawnp under the hood — with exceptions — charliermarsh · 2026-11-25
- fork's copy-on-write still copies page tables, slowing big processes — charliermarsh · 2026-11-25
- Codex cuts process spawn time 800x to 0.25ms via direct posix_spawn — charliermarsh · 2026-11-25