News Feed
Sections




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

Matt Knight's Blog:
Optimising Zend_Config
July 06, 2011 @ 10:39:01

Matt Knight has a recent post looking at a specific part of the Zend Framework, the Zend_Config component, and how it's overhead can be reduced (and somewhat replaced) using a few lines of PHP 5.3-specific code.

One such limitation that I've recently seen is the performance of Zend_Config. This class underpins the mechanism by which developers provide configuration to the application, and all this config is passed around in the form of Zend_Config objects. [...] For the purposes of this article, I'm referring specifically to config INI files, using Zend_Config_Ini to parse. This is a very common format for Zend applications to use - it is familiar to developers and infrastructure support teams - and is the case where the performance issues become apparent

He talks about parsing ini files and the complications that can come with the Zend Framework method of parsing them - conversion to objects via a recursive method, merging data from different sections and the overhead toArray can cause. He shows an alternative that uses array_replace_recursive to handle the parsing and a class version that offers backwards compatibility with the Zend_Config structure. He claims to have seen a sixty percent jump in performance using these methods over the Zend Framework's defaults.

1 comment voice your opinion now!
zendframework zendconfig optimize performance arrayreplacerecursive


blog comments powered by Disqus

Similar Posts

Eran Galperin's Blog: Profiling queries with Zend_Db and optimizing them by hand

Andi Gutmans' Blog: Zend Framework 1.6 Featuring Dojo, SOAP, Testing, and more...

Zend Developer Zone: Zend Framework 1.0.4 Stable and 1.5RC1 Released

Developer.com: Sending Email with PHP

Matthew Weier O'Phinney's Blog: Using Action Helpers To Implement Re-Usable Widgets


Community Events

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


community laravel5 podcast language interview unittest extension laravel release voicesoftheelephpant framework symfony opinion security library version series introduction api threedevsandamaybe

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