Performance: parser-reflection builds a PHP parser on every request (~175 µs)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- php
- Área
- performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- PHP
- Estrellas
- 1.7k
- Forks
- 166
- Merge medio
- 19 h 39 min
- PR fusionados (30 d)
- 48
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
-
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
-
Bug Known Issue
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
goaop/framework#696 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 5/100
Los mantenedores suelen responder en 1 día
Todos los issues de goaop/framework
Issues similares
-
Awaiting Triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
tui: PHP code blocks without `<?php` are not syntax highlightedPosiblemente ocupada @SwastikTripathi la tomó hace 1 día. Abiertoreproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
anomalyco/opencode#58664 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 87/100
WordPress/phpunit-test-runner#364 ·
Los mantenedores suelen responder en 4 días
-
domain/framework Platform(Default) priority/high
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día