News Feed
Sections




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

Brian Moon's Blog:
Big arrays in PHP
February 27, 2007 @ 07:50:00

In his latest blog entry, Brian Moon takes a look at using big arrays in PHP - how efficient it is and what can be done to ease things a bit.

So, at dealnews, we have a category tree. To make life easy, we dump it to an array in a file that we can include on any page. It has 420 entries. So, I was curious how efficient this was. I noticed that some code that was using this array was jumping in memory usage as soon as I ran the script.

His tests showed that the memory jump from before and after the array was significant (5 MB for his test). He tested different methods of storage for the array including a var_export and serializing the data (the lowest memory option).

0 comments voice your opinion now!
large array optimize performance varexport serialize memory usage large array optimize performance varexport serialize memory usage


blog comments powered by Disqus

Similar Posts

Ed Finkler's Blog: What Matt Mullenweg doesn't know about PHP5, and how it hurts him and his users

Zend Developer Zone: Paging Data Sets With PEAR Pager

PHPClasses.org: Lately in PHP, Episode 26 - Accelerating PHP 5.4 with updated PHP cache extensions

ApacheLounge.com: Memory usage Apache + PHP as module versus FastCGI

Bard Farstad's Blog: Optimizing Apache, PHP and APC for Intel based Mac


Community Events





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


api release package symfony community install framework language bugfix series podcast deployment voicesoftheelephpant library introduction zendserver unittest opinion interview laravel

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