#54605Inject annotations should not be used by core (~5% performance)
Description
The case:
Using inject annotations requires the Reflection framework to do expensive runtime analysis of all classes that get loaded (given: only once, if they are Singletons). This extra overhead (I measured it to around 5% in a pretty basic environment with a few extbase plugins) can be very easily avoided by always using injection methods.
I would personally have the core’s classes always use injection methods to increase performance of the base system – and warn users in documentation, that inject annotations should be expected to slow down the code by approximately 5% (also affecting cached contexts, especially affecting the backend).
In our quest for better performance we can take this very easy path without any damage.
A revert merge request is coming right up.
Reviews 5
- main 42310[TASK] Replace @inject with inject methods in other extensions
- main 29453[WIP][TASK] Replace @inject with inject methods
- main 42277[FOLLOWUP][TASK] Replace @inject with inject methods in ext:extbase
- main 42270[TASK] Replace @inject with inject methods in ext:extbase
- main 26565Revert "[TASK] Replace inject methods with @inject"