Skip to content

Adds CLI test fork server for improved test suite performance - #22942

Draft
NickSdot wants to merge 6 commits into
php:masterfrom
NickSdot:perf/cli-test-fork-server
Draft

Adds CLI test fork server for improved test suite performance#22942
NickSdot wants to merge 6 commits into
php:masterfrom
NickSdot:perf/cli-test-fork-server

Conversation

@NickSdot

@NickSdot NickSdot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Extracted from #22917.

Reuses CLI startup via isolated fork server for run-tests.php. Compatible test processes reuse the initialised CLI parent, which forks a fresh child for every invocation. Avoids repeated CLI startup while still having process isolation.

It is limited to compatible POSIX configurations with CLI OPcache disabled. Ineligible tests and server failures fall back to the existing proc_open() path; TEST_PHP_FORK_SERVER=0 can be used to disable it entirely.

Intended to merge after #22957 so the fallback uses structured subprocess commands where possible.

Result

Values in seconds; measured on macOS.

mode master this PR saved speedup
-j1 2224.902 790.015 1434.887 2.82×
-j10 486.665 295.833 190.832 1.65×

Reproduction:

sapi/cli/php run-tests.php -q -j10

Ref: f4947c1#commitcomment-194333284
cc @arnaud-lb

@NickSdot
NickSdot force-pushed the perf/cli-test-fork-server branch from e126e24 to 4c3274a Compare July 30, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant