News Feed
Sections




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

Master Zend Framework:
Using the ClassMap Autoloader for Better Performance
June 19, 2014 @ 11:18:29

Matthew Setter has a new post to his Master Zend Framework site today with a recommendation on how you can use a classmap in your autoloader to reduce the time it takes "searching" for the files it needs.

Zend Framework 2′s been critiqued many times as being slow, at least slower than some of the other leading PHP frameworks. And to be fair, sometimes it's true. But it doesn't need to be and there are simple things you can do to improve performance of your applications. So this post will be the first in a multi-part series looking at ways in which you can improve the performance of your Zend Framework 2 application, with only a minimum of effort. Today, we're looking at the 2 autoloaders which are available in Zend Framework 2; these being the StandardAutoloader and ClassMapAutoloader.

He briefly introduces the concept of autoloaders and the PSR-0 standard that helped to bring a more unified method for their handling. He then gets into examples of using each of the two autoloader types. The Standard version (a fallback if nothing else is set up) resolves things based on a file path and locating classes in the right namespaces. The ClassMap autoloader does this mapping ahead of time and matches a path to a namespace+class. He includes code snippets showing how to set each of them up and a few statistics (using Apache's ab tool) of the difference in performance.

0 comments voice your opinion now!
zendframework2 tutorial autoloader classmap standard performance

Link: http://www.masterzendframework.com/performance-2/classmap-autoloader

blog comments powered by Disqus

Similar Posts

DevShed: Finding Paths, Timestamps and More with the DirectoryIterator Class in PHP

PHPit.net: An introduction to Test Driven Development with PHP

Community News: Zend/PHP Conference & Expo 2007 Site Posted

Codeception.com: Headless Browser Testing with Selenium2 and PhantomJS

DevShed: Main Methods of the DirectoryIterator Class in PHP 5


Community Events

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


composer project example list introduction framework language symfony php7 opinion podcast interview yii2 api series part2 community conference laravel application

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