News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Patrick Allaert:
Composer speeding up class autoloading
January 28, 2013 @ 12:22:43

In this new post Patrick Allaert offers a solution that can help speed up the inclusion of files via the Composer autoloader (in addition to the already present "optimize-autoloader" option).

The problem with the classmap strategy and the nature of PHP is that there is no (easy) way to have a persistent variable across requests containing the classmap. [...] This [large returned array of mappings] can even take a big portion of your request's response time when you have hundreds or thousands of classes like it is the case with eZ Publish 5 being based on Symfony, where about 2 600 classes are involved.

He suggests something that could be included into the Composer functionality itself - creating symbolic links in the PSR-0 standard to the location of the files to make it easier for Composer to resolve their location (based on namespace, not having to find them). Some sample code is included showing an additional autoloader that then uses the vendor names to match the path directly.

0 comments voice your opinion now!
composer symlinks autoload speed performance


blog comments powered by Disqus

Similar Posts

SitePoint WordPress Blog: Speed Up Your WordPress Site

David Sklar\'s Blog: Speed - DOM traversal vs. XPath in PHP 5

Ruslan Yakushev's Blog: Slides and Questions from PHP on Windows Webcast

SitePoint PHP Blog: Easy Wins For More Performant PHP

PHPClasses.org: Lately in PHP, Episode 32 - Zend Optimizer+ Cache in PHP 5.5 & MySQL 5.6


Community Events





Don't see your event here?
Let us know!


tips conference framework laravel bugfix list symfony community interview language voicesoftheelephpant threedevsandamaybe podcast api code series introduction zendserver deployment release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework