Skip to content

Native PHP worker pool on all platforms#3602

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

Native PHP worker pool on all platforms#3602
bcotrim wants to merge 10 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 f04bfdd vs trunk

app-size

Metric trunk f04bfdd Diff Change
App Size (Mac) 1328.04 MB 1328.05 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk f04bfdd Diff Change
load 1770 ms 1698 ms 72 ms 🟢 -4.1%

site-startup

Metric trunk f04bfdd Diff Change
siteCreation 9023 ms 9512 ms +489 ms 🔴 5.4%
siteStartup 4397 ms 4877 ms +480 ms 🔴 10.9%

Results are median values from multiple test runs.

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

@bcotrim bcotrim requested a review from fredrikekelund May 31, 2026 07:33
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