I'm working on a project with Zend Framework 1.11, Doctrine 2, some Symfony 2 componenents and others tools & libraries.
I'm trying to optimize performance using Xdebug & Webgrind.
I've already found some bottlenecks like parsing Ini config, etc.. and cached that.
Now, I just realize that the autoloading is the most costly part of my application:
Opl\Autoloader\ApcLoader->loadClass 274 31.36 43.86
Zend_Loader_PluginLoader->load 150 4.80 12.29
Zend_Loader_Autoloader->getClassAutoloaders 278 1.42 1.91
Zend_Controller_Router_Route_Regex->_getMappedValues 291 1.29 1.35
Doctrine\ORM\UnitOfWork->createEntity 85 1.24 3.18
As you can see I'm not using the default Zend_Loader_Autoloader
, I'm using Opl
which is, as far I know, quicker than it, I'm using the classMapLoader
with an APC cache but it still a bit slows compared to rest of the application.
How could I optimize that?
I've around 250 classes loaded, and it looks that only ~40 are slow, others show 0,00 as "Total call cost" but others are increasing from 0,08 to 0,57 on the require call.
By the way, since using the Opl autoloader, it looks that on my production environnement APC only opcode cache the file which are "manually required" not the ones which are called by the autoloader.