Performance: cache warmup walks the application tree twice and descends into excluded directories
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, performance
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- PHP
- Stelle
- 1.7k
- Fork
- 166
- Merge medio
- 11h 20m
- PR unite (30g)
- 37
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di goaop/framework
-
Intercepting a method imported from a trait with #[\Override] fails: OriginalAlias "has #[\Override] attribute, but no matching parent method exists"Forse già presa @lisachenko l’ha presa 2 giorni fa. ApertaBug PHP8.4
Difficoltà 3/5 Mezza giornata Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Several woven classes in one file: their proxies overwrite each other, all but the last class are lost (Class not found)Forse già presa @lisachenko l’ha presa 2 giorni fa. ApertaBug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
I maintainer di solito rispondono entro 1 giorno
-
Enhancement Performance
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
goaop/framework#747 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Enhancement Performance To Be Discussed
Difficoltà 3/5 Mezza giornata Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
Feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di goaop/framework
Issue simili
-
needs-triage Platform(Default)
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
[Store] RstLoader detects headings inside indented code blocksForse già presa @lazerg l’ha presa oggi. ApertaBug Status: Needs Review Store
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug repo:ckeditor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
No Code Attached Yet
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
joomla/joomla-cms#48611 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno