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

@NickSdotNickSdot 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.

modemasterthis PRsavedspeedup
-j12224.902790.0151434.8872.82×
-j10486.665295.833190.8321.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
NickSdotforce-pushed the perf/cli-test-fork-server branch from 4ffee67 to 85f2e0eCompareAugust 3, 2026 16:53
@NickSdot

Copy link
Copy Markdown
ContributorAuthor

This can be rebased now that #22957 is merged

Done.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@NickSdot@arnaud-lb