Codex cuts process spawn from 200ms to 0.25ms by skipping a 20GB page-table copy

petrusenko_max · x · 2026-11-25

Codex now spawns processes much faster when the app server itself is using significant memory: on macOS with 20GB of resident memory in the parent, launch time dropped from 200ms to 0.25ms — an 800x speedup.

Developer petrusenkomax explains the mechanism in a reply: the 200ms was spent forking and copying a 20GB page table, and spawn simply skips that copy. A neat systems-level lesson: for large-memory server processes, the copy-on-write page-table copy in fork is often the dominant startup cost, and switching to spawn semantics sidesteps it entirely.

Related event: Codex Cuts Process Startup Time 800x by Replacing fork+exec with posix_spawn(8 posts)→

Original post →

More from coding & agent

coding & agent channel →