News Feed
Jobs Feed
Sections




News Archive
php|architect:
Putting glob() to the test
April 29, 2010 @ 09:27:57

The glob function, the subject of a recent post on NETTUTS.com, is the topic of this new post from Bill Karwin on the php|architect website. He focuses on the efficiency of the function over the convenience it offers.

The glob() function is convenient but the solution using the fewest lines of code isn't always the most efficient - if by efficient you mean fastest. [...] My benchmark results ranged from 12.4 seconds down to 1.2 seconds. That's a pretty wide spread, so it's worth paying attention to performance as well as coding convenience.

He shows the different methods he used to get those results, one that returned an array and filtered directories, another that didn't filter and a third using the GLOB_NOSORT argument. He also compares it with scandir and the opendir/readdir combo.

0 comments voice your opinion now!
glob benchmark file directories performance


blog comments powered by Disqus

Similar Posts

Chris Jones: Converting REF CURSOR to PIPE for Performance in PHP OCI8 and PDO_OCI

Brian Moon's Blog: PDO Turbo Button

Gonzalo Ayuso: Scaling Silex applications

Dotvoid.com: PHP 5.2 ajaxified

Fabian's Blog: Better Performance patch for Symfony 1.0.x and Propel 1.2


Community Events











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


conference community introduction zendframework2 symfony2 functional usergroup interview testing release unittest series development podcast database framework language phpunit opinion rest

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