Files
codebase-memory-mcp/tests
Andrew Hundt fce4733078 perf(subprocess): poll short-lived workers every 5 ms
The cbm_run_posix reap loop slept for 100 ms whenever waitpid(WNOHANG) observed a live child, and cbm_run_win waited 200 ms. That fixed delay dominated short index workers even when optional graph algorithms were disabled.

Add cbm_subprocess_poll_interval_ms in src/foundation/subprocess.c and use a 5 ms cadence during the first 250 ms in both supervisor loops. After the bounded window, POSIX returns to 100 ms and Windows returns to 200 ms, preserving steady-state wakeup complexity, cancellation, quiet-timeout, and process-tree cleanup behavior.

tests/test_subprocess.c covers the 0/249/250 ms policy boundaries and a POSIX short-child latency canary. Verified on macOS with CBM_ONLY_SUITE=subprocess build/c/test-runner (19 passed) and make -j2 -f Makefile.cbm cbm (-O2 production build). The pure Windows policy is covered, but no native Windows execution is claimed.

Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
2026-07-16 08:18:18 -04:00
..
2026-07-08 00:05:19 +05:30