I need optimize my symfony in terms of speed. The hosting server is running php 7.x.x and opcache is enabled. apc_u
extension is disabled but I could ask to enable it if really needed.
What I'm doing now is calling:
composer dump-autoload --optimize
whenever I deploy my app. That way, the app should already have all the mappings needed without having to iterate over the folders (right?). I'm wondering if ApcClassLoader
could improve my performances if autoload_classmap.php
is already well updated.
Here are my app.php
first lines:
use Symfony\Component\HttpFoundation\Request;
/**
* @var Composer\Autoload\ClassLoader
*/
$loader = require __DIR__.'/../app/autoload.php';
include_once __DIR__.'/../app/bootstrap.php.cache';
// Enable APC for autoloading to improve performance.
// You should change the ApcClassLoader first argument to a unique prefix
// in order to prevent cache key conflicts with other applications
// also using APC.
/*
$apcLoader = new Symfony\Component\ClassLoader\ApcClassLoader(sha1(__FILE__), $loader);
$loader->unregister();
$apcLoader->register(true);
*/
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
long question short: could enabling ApcClassLoader
improve my performances if autoload_classmap.php
is already well updated?