Performance: cache warmup walks the application tree twice and descends into excluded directories
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- PHP
- Estrellas
- 1.7k
- Forks
- 166
- Merge medio
- 11 h 20 min
- PR fusionados (30 d)
- 37
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de goaop/framework
-
Intercepting a method imported from a trait with #[\Override] fails: OriginalAlias "has #[\Override] attribute, but no matching parent method exists"Posiblemente ocupada @lisachenko la tomó hace 3 días. AbiertoBug PHP8.4
Dificultad 3/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Several woven classes in one file: their proxies overwrite each other, all but the last class are lost (Class not found)Posiblemente ocupada @lisachenko la tomó hace 3 días. AbiertoBug
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
Enhancement Performance
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
goaop/framework#747 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Enhancement Performance To Be Discussed
Dificultad 3/5 Medio día Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
Feature
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de goaop/framework
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
WordPress/hosting-handbook#506 ·
Los mantenedores suelen responder en 2 días
-
Installing a plugin with composer_packages installs dev dependencies and breaks the autoloader (Error 500)Posiblemente ocupada @Boy132 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
nginx: static-file locations drop the security headers, and the dotfile deny is matched after themAbiertobug Low Security
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
backdrop-contrib/commerce#60 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100