Performance: cache warmup walks the application tree twice and descends into excluded directories
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend, performance
調査の方向性
Start with src/Instrument/ClassLoading/CacheWarmer.php and src/Instrument/FileSystem/Enumerator.php, then read the related Enumerator and CacheWarmer tests. Check how the Finder iterator is counted, rewound, and filtered, including wildcard exclusions, before changing the traversal. Done means the same files are processed, excluded directories are pruned safely, the tests cover both classes, and timing is compared on a tree with a large excluded directory.
索引モデルが issue の本文から書いたものです。
説明
Problem
- Two walks:
CacheWarmer::warmUp()counts the files withiterator_count($iterator)and then calls$iterator->rewind()(src/Instrument/ClassLoading/CacheWarmer.php:80-84). Rewinding the Finder iterator walks the wholeappDiragain, callinggetRealPath()and the path filter for every file. - No pruning:
Enumerator::enumerate()(src/Instrument/FileSystem/Enumerator.php:54-61) applies the include/exclude filter per file only. Finder still descends into every excluded directory: the cache directory, the framework's runtime dependencies, and userexcludePathssuch asvendor/ornode_modules/.
Measurement
appDir = vendor/ (3,942 PHP files): count pass 53 ms, second pass 44 ms. The cost grows with the size of excluded trees, which can be much larger than the woven code, for example a full vendor/ plus node_modules/ under the app root.
Proposal
- One walk: collect the iterator once (
iterator_to_array(..., false), which also removes the separate Windows rewind workaround), then count and process from that array. - Prune excluded directories: use Finder's
filter(..., prune: true), available since symfony/finder 6.4 (the framework requires^7.4 || ^8.0), orexclude()with paths relative toin(). Match the directory against the same prefix regex asgetPathFilter(). Exclude patterns with*wildcards that could still match files inside a directory must not prune it.
Acceptance
- The warmup processes exactly the same files as before; extend the
EnumeratorandCacheWarmertests. - A timing of the enumeration before and after on a tree with a large excluded directory.
Estimate
Halves the enumeration time, and more when large excluded trees sit under appDir. Low risk, small change.
- 主要言語
- PHP
- スター
- 1.7k
- フォーク
- 166
- 平均マージ
- 20時間 56分
- マージ済み PR(30日)
- 45
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
goaop/framework のほかの issue
-
Enhancement Performance
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
goaop/framework#747 · コメント 1 件 ·
メンテナーはふだん 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
-
[Enhancement] Add a dark-bg Tailwind variant対応中かも @bd-viget が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
vigetlabs/wordpress-site-starter#306 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Spomky-Labs/pwa-bundle#476 ·
-
domain/discovery
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
code4romania/cpc#64 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信