News Feed
Sections




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

WebDevLogs.com:
BREAK the FOR VS WHILE loop war
March 27, 2007 @ 11:37:00

In this new post on Mgccl's blog today, there's a response to these benchmarks from John Walsh concerning which is faster - a for loop or a while loop.

In this new post, Mgccl, he points out two other examples that show that a while loop is always faster than a for loop. To help prove the point, he's also included a screencast where he shows the code he's using to run the benchmarks (several different tests).

His results, matching the results from the other reports, not only shows that the while loop is faster (still only slightly), but also consumes less memory in the process.

1 comment voice your opinion now!
forloop whileloop benchmark statistic screencast forloop whileloop benchmark statistic screencast


blog comments powered by Disqus

Similar Posts

Ulf Wendel: PHP Memcache access to MySQL 5.7, faster? Redis?

SitePoint PHP Blog: PHP Dependency Injection Container Performance Benchmarks

Tiffany Brown's Blog: Collecting e-commerce conversion data with Zen Cart and Google Analytics

Zend Developer Zone: Zend Platform Event Debugging

Community Crosstalk: Matthew O'Phinney & Scott Johnson on Dynamic Function/Method Calls


Community Events





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


conference opinion library release security language framework artisanfiles series list version introduction interview tool community podcast symfony laravel composer voicesoftheelephpant

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