Description
Symfony version(s) affected
7.0.5
Description
For the tag controller.argument_value_resolver
, the argument_resolver.request
service has a priority of 50, while doctrine.orm.entity_value_resolver
has a priority of 110. As a result, EntityValueResolver from DoctrineBundle first tries to resolve the Symfony\Component\HttpFoundation\Request
controller argument as an entity. This is nonsensical and will cause Doctrine to try to find an entity manager and repository
65EC
for it. In my case this leads to an extra 40-50ms of Total execution time on average.
By changing the priority of argument_resolver.request
to 150, the Request argument is resolved immediately without this detour.
How to reproduce
Create a clean installation of symfony/skeleton
and require symfony/webapp-pack
. Create a controller with a Request $request
function argument and visit it. Inspect the Performance profiler page for the request.
Possible Solution
No response
Additional Context
No response