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

@arnaud-lb

Copy link
Copy Markdown
Member

This can be rebased now that #22957 is merged

@NickSdot
NickSdot force-pushed the perf/cli-test-fork-server branch from 4ffee67 to 85f2e0e Compare August 3, 2026 16:53
@NickSdot

NickSdot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

This can be rebased now that #22957 is merged

Done.

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.

2 participants