Optimize the composer autoload by using Phalcon\Loader.
$composerOptimizer = new \Neutrino\Optimizer\Composer(
'{path to optimized loader file}',
'{path to vendor/composer}',
'{path to your base application path}',
);
$composerOptimizer->optimizeMemory();
Memory optimizer use composer dumpautoload without " --optimize ".
This significantly reduces the size of the autoload_classmap.php file and therefore the size of the generated file. This implies that the classes will not have a direct path to their file, and thus an additional processing on the part of the autoloader (Phalcon \ Loader).
$composerOptimizer->optimizeProcess();
Process optimizer use composer dumpautoload with " --optimize ".
This allows to load the autoload with the link each used. This generates a huge array that will accelerate the loading process of the class.
In your bootstrap file, Change your call of composer/autoload.php by :
// Load compiled autoloader. (Phalcon)
if (file_exists("{path to optimized loader file}")) {
require "{path to optimized loader file}";
return;
}
/**
* Load composer autoloader.
*/
require "{path to vendor/composer/autoload.php}"