Performance: parser-reflection builds a PHP parser on every request (~175 µs)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- php
- 領域
- performance
調査の方向性
Read src/bootstrap.php, which calls ReflectionEngine::init(new ComposerLocator()), then ReflectionEngine::parseFile() and locateClassFile() to see where the parser and locator are actually needed. The fix spans two repositories: make parser/locator creation lazy in parser-reflection (dropping or emptying the composer files entry), cut a release, then raise the constraint in this repo's composer.json. Done looks like a warm request no longer builds the Php8 parser and the ~175 µs bootstrap cost disappears.
索引モデルが issue の本文から書いたものです。
説明
Problem
goaop/parser-reflection registers src/bootstrap.php as a composer files autoload entry. On every request it calls ReflectionEngine::init(new ComposerLocator()), which builds the Php8 parser and lexer.
The framework parses only on a cache miss (StreamMetaData → ReflectionEngine::parseFile()), so a warm production request never uses this parser. It is still built on every request by every app that has the framework installed, even one that never starts an aspect kernel.
Measurement
Warm opcache (built-in server, opcache.validate_timestamps=0, median of 100–200 requests), small app with 25 woven classes:
| phase | µs |
|---|---|
| parser-reflection bootstrap (inside composer autoload) | ~176 |
whole AspectKernel::init() |
~143 |
| total extra cost of AOP vs plain composer | ~405 |
The bootstrap alone costs more than the whole kernel init.
Proposal
- In parser-reflection: create the parser and locator lazily on the first
ReflectionEngine::getParser()/parseFile()/locateClassFile()call, and make thefilesbootstrap free (or drop it). - Release parser-reflection, then raise the constraint in this repository's
composer.json.
Estimate
About −175 µs on every request, roughly 30% of the per-request cost the framework adds today. Low risk, small change, but it needs a parser-reflection release.
- 主要言語
- PHP
- スター
- 1.7k
- フォーク
- 166
- 平均マージ
- 9時間 50分
- マージ済み PR(30日)
- 30
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
goaop/framework のほかの issue
-
Performance: avoid array_slice(…, func_num_args()) in generated methods when all arguments are passed対応中かも @lisachenko が 1 日前に担当しました。 オープンEnhancement Performance
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
Enhancement Performance To Be Discussed
難易度 3/5 半日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
Feature
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
Bug Known Issue
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
goaop/framework#696 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 5/100
メンテナーはふだん 1 日以内に返信
goaop/framework の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
api-platform/core#8649 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
open-telemetry/opentelemetry-php#2071 ·
メンテナーはふだん 1 日以内に返信
-
bug No Code Attached Yet
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
joomla/joomla-cms#48587 ·
メンテナーはふだん 1 日以内に返信
-
priority:low type:docs
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
crazy-goat/rabbit-stream#662 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
FOSSBilling/FOSSBilling#4498 ·
メンテナーはふだん 1 日以内に返信