Research on composer optimized autoloader
Composer uses a dynamic autoloader. In production, when running composer dump-autoload --optimize
, the autoloading will be static as composer adds all known classes to the autoload list in files.
We should run some benchmarks to find out if this really improves performance-
Then, when also adding another argument and run composer dump-autoload --optimize --apcu
, the class list will be held in APCu, i.e. in RAM. That sounds even more performant, but we need to make sure that this runs in the correct PHP container; otherwise the list will end up in the wrong APCu.