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

SitePoint PHP Blog: HHVM and Hack - Can We Expect Them to Replace PHP?

PHP-GTK Blog: How to: PHP 5.3 with PHP-GTK and Cairo on Linux Mint 9

IBM developerWorks: PHP encryption for the common man

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

SitePoint PHP Blog: Popular Photos, Filters and User Profiles with the 500px API


Community Events

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


community voicesoftheelephpant series xdebug language release unittest podcast install library opinion api laravel5 example extension framework laravel php7 interview introduction

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