Skip to content

Native PHP worker pool on all platforms#3602

Open
bcotrim wants to merge 7 commits into
trunkfrom
add-native-php-worker-pool-poc
Open

Native PHP worker pool on all platforms#3602
bcotrim wants to merge 7 commits into
trunkfrom
add-native-php-worker-pool-poc

Conversation

@bcotrim
Copy link
Copy Markdown
Contributor

@bcotrim bcotrim commented May 22, 2026

Related issues

  • Fixes #

How AI was used in this PR

Proposed Changes

Using PHP_CLI_SERVER_WORKERS for concurrency is only supported on macOS and Linux. We want concurrency on Windows, too. This PR accomplishes that by implementing a Node.js HTTP load balancer that proxies requests to a fixed pool of 4 php -S processes. This works surprisingly well in our testing.

In our benchmarks, this solution yields ~30% performance improvement on Windows compared to Playground.

Testing Instructions

CI should pass

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@bcotrim bcotrim self-assigned this May 22, 2026
Comment thread apps/cli/php-server-child.ts Fixed
Comment thread apps/cli/php-server-child.ts Fixed
bcotrim and others added 3 commits May 28, 2026 18:58
… through a stack trace'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@fredrikekelund fredrikekelund changed the title Add native PHP worker pool POC Native PHP worker pool on all platforms May 29, 2026
@fredrikekelund fredrikekelund marked this pull request as ready for review May 29, 2026 16:00
@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented May 29, 2026

📊 Performance Test Results

Comparing 8258fbd vs trunk

app-size

Metric trunk 8258fbd Diff Change
App Size (Mac) 1337.93 MB 1337.94 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk 8258fbd Diff Change
load 1733 ms 1739 ms +6 ms ⚪ 0.0%

site-startup

Metric trunk 8258fbd Diff Change
siteCreation 9052 ms 9226 ms +174 ms 🔴 1.9%
siteStartup 4390 ms 4867 ms +477 ms 🔴 10.9%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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.

4 participants