Angaben zum Datum
Datum aus der Quelle.
Erstmals gesehen am .
Symfony 8.2: Compiled Event Dispatcher
In Symfony 8.2 ist der Service event_dispatcher ein CompiledEventDispatcher, der Listener vorab beim Kompilieren des Containers erfasst und per Service Locator bei Bedarf lädt, statt sie bei jedem Request zur Laufzeit zu registrieren.
Contributed by Nicolas Grekas in #66122 , #66129 , #66131 and #66133
Symfony 8.2 includes lots of performance improvements, but we keep looking for new opportunities to make your applications faster.
For example, Symfony creates the event dispatcher at runtime for every request by calling addListener() for each listener and wrapping it in a closure, even for events that the request never dispatches. But Symfony already knows your application's event listeners when it compiles the container, so this work can be done ahead of time.
Compiled Event Dispatcher
In Symfony 8.2, the event_dispatcher service is a CompiledEventDispatcher. It receives an array of listener service IDs and methods, in the order they run, and a service locator to load them when needed. PHP's OPcache stores the array in shared memory, so each request doesn't need its own copy. …