Slow no-op installs on macOS: repeated PHP and pkg-config subprocesses
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- php
- 領域
- performance
調査の方向性
Start by tracing Php\Pie\Util\Process::run() and the PHP-installation and dependency queries it serves; the issue names no source files or tests, so first locate those call sites and relevant tests. Reproduce with the supplied pie install command and profile repeated PHP and pkg-config invocations. Done means already-installed extensions are still verified correctly with redundant query results reused within one invocation and runtime reduced.
索引モデルが issue の本文から書いたものです。
説明
What are you trying to do?
Run pie install for seven already-installed extensions. All extensions are verified successfully; nothing is compiled or updated.
What platform, and PIE version are you using?
- PIE 1.5.1
- Homebrew PHP 8.4.26, NTS, ARM64 on both platforms
- macOS 27.0.1 (26A434), compared with Linux ARM64
Steps to reproduce the issue
With the extensions already installed, invoke PIE directly on macOS:
/usr/bin/time /opt/homebrew/opt/[email protected]/bin/php /opt/homebrew/bin/pie install \
apcu/apcu mongodb/mongodb-extension pecl/pcov phpredis/phpredis \
noisebynorthwest/php-spx --with-zlib-dir=/opt/homebrew/opt/zlib \
xdebug/xdebug bsn4/grpc
What do you expect to happen?
Verification of already-installed extensions should complete quickly, avoiding repeated identical queries of the PHP installation and system dependencies.
What is actually happening?
The direct macOS invocation takes 46.19 seconds:
46.19 real 36.34 user 7.65 sys
An equivalent verbose Linux run takes 8.44 seconds (3.47 seconds user, 1.33 seconds system). A verbose macOS run takes 47.95 seconds (37.24 seconds user, 8.10 seconds system).
Logs/output
The direct macOS run reports:
PIE 1.5.1
You are running PHP 8.4.26
Target PHP installation: 8.4.26 nts, on Linux/OSX/etc arm64
Found package: apcu/apcu:v5.1.28 which provides ext-apcu
Found package: mongodb/mongodb-extension:2.5.3 which provides ext-mongodb
Found package: pecl/pcov:v1.0.12 which provides ext-pcov
Found package: phpredis/phpredis:6.3.0 which provides ext-redis
Found package: noisebynorthwest/php-spx:v0.4.22 which provides ext-spx
Found package: xdebug/xdebug:3.5.3 which provides ext-xdebug
Found package: bsn4/grpc:v0.4.0 which provides ext-grpc
✅ PIE package apcu/apcu (apcu) is already installed and verified.
✅ PIE package bsn4/grpc (grpc) is already installed and verified.
✅ PIE package mongodb/mongodb-extension (mongodb) is already installed and verified.
✅ PIE package noisebynorthwest/php-spx (spx) is already installed and verified.
✅ PIE package pecl/pcov (pcov) is already installed and verified.
✅ PIE package phpredis/phpredis (redis) is already installed and verified.
✅ PIE package xdebug/xdebug (xdebug) is already installed and verified.
Anything else?
Timing Php\Pie\Util\Process::run() in a temporary copy of the installed PHAR, using microtime(true) around each invocation and logging the command and elapsed time in a finally block, produced a similar total runtime of 46.81 seconds:
| Subprocess | Calls | Cumulative elapsed time |
|---|---|---|
| PHP | 114 | 35.84 s |
| pkg-config | 810 | 8.88 s |
| php-config | 1 | 0.01 s |
PHP invocations included 47 full-version queries, 30 loaded-extension queries, 13 major/minor-version queries, and 11 php -i calls.
Normal PHP startup on this Mac takes approximately 0.31 seconds per launch. Disabling Xdebug did not improve the overall runtime (48.90 seconds). Removing MongoDB's INI from a temporary configuration reduced PHP startup from approximately 0.317 to 0.167 seconds, but was only used to measure startup, not to run installation verification.
The subprocess measurements identify where the macOS run spends its time; equivalent subprocess profiling has not been performed on Linux, so the underlying platform difference is not established.
Could PHP installation information and dependency query results be cached within a single PIE invocation? Repeated subprocess calls appear to amplify startup overhead substantially for already-installed extensions.
- 主要言語
- PHP
- スター
- 2k
- フォーク
- 74
- 平均マージ
- 6時間 35分
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
php/pie のほかの issue
-
OndrejPhpenmod used even when PHP invoking it is different対応中かも @asgrim が 1 日前に担当しました。 オープンbug bug-confirmed maintainer investigating
メンテナーはふだん 1 日以内に返信
-
pcre2.h missing on Brew PHP setups対応中かも @asgrim が 1 日前に担当しました。 オープンbug bug-confirmed maintainer investigating
メンテナーはふだん 1 日以内に返信
-
PIE checksum fails with Ubuntu PHP 8.1.2 package対応中かも @asgrim が今日担当しました。 オープンbug maintainer investigating
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
php/pie#757 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Do not duplicate an ext in pie show output for dev versions対応中かも @asgrim が 9 日前に担当しました。 オープンenhancement maintainer investigating
メンテナーはふだん 1 日以内に返信
-
Add self-update feature for executable PIEs対応中かも @asgrim が 20 日前に担当しました。 オープンenhancement maintainer investigating
メンテナーはふだん 1 日以内に返信
似ている issue
-
Bug Enhancement Performance
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Feature Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
frontend low-priority
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
mplodowski/dynamicpdf-plugin#336 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AdvancedCustomFields/acf#1044 ·
-
Add Zammad対応中かも @Arslan-TR が今日担当しました。 オープンrequest
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
endoflife-date/endoflife.date#11298 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信