<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: PHPBench.com: Live PHP benchmarks, demystifying &#8220;best practices&#8221;</title>
	<atom:link href="http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<pubDate>Tue, 02 Dec 2008 04:40:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Brian ....</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-754668</link>
		<dc:creator>Brian ....</dc:creator>
		<pubDate>Wed, 02 Jul 2008 13:47:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-754668</guid>
		<description>What a load of pony

&#60;snip&#62;
For example, foreach($aHash as $val) has script execution time of 558% compared to while(list($key) = each($aHash)) $tmp[] = $aHash[$key] with 100%.
&#60;/snip&#62;

That is not what is on Vincent's site ... in fact it says exactly the opposite ... this is two teenagers w4nking each other off ... expert php programmers my expert a$$</description>
		<content:encoded><![CDATA[<p>What a load of pony</p>
<p>&lt;snip&gt;<br />
For example, foreach($aHash as $val) has script execution time of 558% compared to while(list($key) = each($aHash)) $tmp[] = $aHash[$key] with 100%.<br />
&lt;/snip&gt;</p>
<p>That is not what is on Vincent&#8217;s site &#8230; in fact it says exactly the opposite &#8230; this is two teenagers w4nking each other off &#8230; expert php programmers my expert a$$</p>]]></content:encoded>
	</item>
	<item>
		<title>By: d</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-747962</link>
		<dc:creator>d</dc:creator>
		<pubDate>Thu, 19 Jun 2008 23:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-747962</guid>
		<description>Regarding foreach: please keep in mind that foreach works on a &lt;em&gt;copy&lt;/em&gt; of your array, and while/each() loops over a &#38;reference to it. This means that for us 1% who do need to optimize ALL of our code, every nanogram of performance counts. Using big iron doesn't matter, because no matter how much you boost your systems, sales is coming up with brave new ways to bog it down. foreach was a great leap forward stylistically from pre-php4 days, and is a well-loved workhorse of a tool, but readability is secondary because (USER === GOD)

Need to do a massive sort when massaging data, without having ORDER BY put a temp table on disk, relatively tight memory conditions with dozens of requests-per-second and C/C++ isn't a good fit because of platform interoperability? Profiling can find the bottlenecks, but its lists like this that'll give you some options to try when foreach copies your array. The same ideas applies to using Yslow, EXPLAINing queries, checking the slow query log, etc., etc., etc. Best practices come from some reading and lots and lots of practice, or to quote Niels Bohr: "An expert is a person who has made all the mistakes that can be made in a very narrow field."</description>
		<content:encoded><![CDATA[<p>Regarding foreach: please keep in mind that foreach works on a <em>copy</em> of your array, and while/each() loops over a &amp;reference to it. This means that for us 1% who do need to optimize ALL of our code, every nanogram of performance counts. Using big iron doesn&#8217;t matter, because no matter how much you boost your systems, sales is coming up with brave new ways to bog it down. foreach was a great leap forward stylistically from pre-php4 days, and is a well-loved workhorse of a tool, but readability is secondary because (USER === GOD)</p>
<p>Need to do a massive sort when massaging data, without having ORDER BY put a temp table on disk, relatively tight memory conditions with dozens of requests-per-second and C/C++ isn&#8217;t a good fit because of platform interoperability? Profiling can find the bottlenecks, but its lists like this that&#8217;ll give you some options to try when foreach copies your array. The same ideas applies to using Yslow, EXPLAINing queries, checking the slow query log, etc., etc., etc. Best practices come from some reading and lots and lots of practice, or to quote Niels Bohr: &#8220;An expert is a person who has made all the mistakes that can be made in a very narrow field.&#8221;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent_</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-740900</link>
		<dc:creator>Vincent_</dc:creator>
		<pubDate>Sat, 07 Jun 2008 02:23:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-740900</guid>
		<description>-- This is written by "the" chris vincent... --

Not to be intruding or anything.... but if you actually read everything on phpbench.com, including the item down the bottom, you'll notice that I indeed know clearly all that has been said within this page. The intent of showing off these benchmarks was &lt;strong&gt;not&lt;/strong&gt; whatsoever the purpose of this page. 

I am no expert at what I do, but I put most of my time into algorithms, mysql benchmarking and server optimisation as any php expert should. Please don't lecture people how the "right" way of doing things without understanding the correct situation, instead, please just put your ideas on the table and discuss this through like the responsible people you are.

I'd continue but I think that's all that needs to said.</description>
		<content:encoded><![CDATA[<p>&#8211; This is written by &#8220;the&#8221; chris vincent&#8230; &#8211;</p>
<p>Not to be intruding or anything&#8230;. but if you actually read everything on phpbench.com, including the item down the bottom, you&#8217;ll notice that I indeed know clearly all that has been said within this page. The intent of showing off these benchmarks was <strong>not</strong> whatsoever the purpose of this page. </p>
<p>I am no expert at what I do, but I put most of my time into algorithms, mysql benchmarking and server optimisation as any php expert should. Please don&#8217;t lecture people how the &#8220;right&#8221; way of doing things without understanding the correct situation, instead, please just put your ideas on the table and discuss this through like the responsible people you are.</p>
<p>I&#8217;d continue but I think that&#8217;s all that needs to said.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: TheRedDevil</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-740893</link>
		<dc:creator>TheRedDevil</dc:creator>
		<pubDate>Sat, 07 Jun 2008 02:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-740893</guid>
		<description>If anything, that site is advocating the worst practices...

First off the results are horribly wrong for most of the tests, not to mention the most efficient solutions are in many of the cases not even there.

The author (Chris) also does not seem to understand why the tests "vary". Performance benchmarks of this type must always be run in an confined enviroment with no unnecessarily processes running. Running them on a shared hosting account, is a clear sign that he dont know what hes doing.

I also strongly recommend that you read up on the differences between php4 and php5 Chris.


To be honest I had expected better from a SitePoint article, this place is starting to provide articles in similar quality as those you find in gossip magazines. It is articles like this one that is the reason that there is 99 bad PHP developers for each good one.


As others has mentioned above, pre-optimicing is the source of all evil. Dont give away code readability for optimicing its not even sure you need. In most cases, easy readable code is also the most efficient. Though, every developer has their own "version" of what is easily readable code ;)</description>
		<content:encoded><![CDATA[<p>If anything, that site is advocating the worst practices&#8230;</p>
<p>First off the results are horribly wrong for most of the tests, not to mention the most efficient solutions are in many of the cases not even there.</p>
<p>The author (Chris) also does not seem to understand why the tests &#8220;vary&#8221;. Performance benchmarks of this type must always be run in an confined enviroment with no unnecessarily processes running. Running them on a shared hosting account, is a clear sign that he dont know what hes doing.</p>
<p>I also strongly recommend that you read up on the differences between php4 and php5 Chris.</p>
<p>To be honest I had expected better from a SitePoint article, this place is starting to provide articles in similar quality as those you find in gossip magazines. It is articles like this one that is the reason that there is 99 bad PHP developers for each good one.</p>
<p>As others has mentioned above, pre-optimicing is the source of all evil. Dont give away code readability for optimicing its not even sure you need. In most cases, easy readable code is also the most efficient. Though, every developer has their own &#8220;version&#8221; of what is easily readable code ;)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dorsey</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-740809</link>
		<dc:creator>Dorsey</dc:creator>
		<pubDate>Fri, 06 Jun 2008 20:44:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-740809</guid>
		<description>I agree completely with &lt;em&gt;metapundit&lt;/em&gt;:  spend more time on design issues (algorithms, DB schema and tuning, and a usable human interface) and less on dopey little coding issues such as single vs. double quotes.  In the long run (as has been amply demonstrated and documented in the past 30 years, and as any senior IT manager will tell you), the biggest cost of software is &lt;strong&gt;maintenance&lt;/strong&gt;, so make your code readable and logical (as opposed to really, really, clever) so that the person picking it up after you can make sense of out of it to the point of developing the confidence to improve or correct your work.

By the way, am I the only one appalled that SitePoint (who I really like and depend upon for accurate commentary) blundered so badly on this article?  It seems as if nearly everyone who ran the benchmarks themselves found just the opposite of the authors, and a simple peer review might have avoided that embarrassment.

My compliments and appreciation to &lt;em&gt;metapundit&lt;/em&gt; for expressing all of those thoughts.

Dorsey</description>
		<content:encoded><![CDATA[<p>I agree completely with <em>metapundit</em>:  spend more time on design issues (algorithms, DB schema and tuning, and a usable human interface) and less on dopey little coding issues such as single vs. double quotes.  In the long run (as has been amply demonstrated and documented in the past 30 years, and as any senior IT manager will tell you), the biggest cost of software is <strong>maintenance</strong>, so make your code readable and logical (as opposed to really, really, clever) so that the person picking it up after you can make sense of out of it to the point of developing the confidence to improve or correct your work.</p>
<p>By the way, am I the only one appalled that SitePoint (who I really like and depend upon for accurate commentary) blundered so badly on this article?  It seems as if nearly everyone who ran the benchmarks themselves found just the opposite of the authors, and a simple peer review might have avoided that embarrassment.</p>
<p>My compliments and appreciation to <em>metapundit</em> for expressing all of those thoughts.</p>
<p>Dorsey</p>]]></content:encoded>
	</item>
	<item>
		<title>By: metapundit</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-738801</link>
		<dc:creator>metapundit</dc:creator>
		<pubDate>Tue, 03 Jun 2008 20:02:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-738801</guid>
		<description>I'm so happy to see that there is some sanity in the PHP community. @Lachlan and the following posts: you are exactly right! I'm past being sick of these kind of benchmarks - I'm pissed that semi-authoritative places like sitepoint link to crap like this and really believe that such benchmarks are counterproductive to the PHP community as a whole.

That's a little inflammatory so let me get a few things out of the way. I'm not knocking Chris Vincent - I've never heard of him and I'm willing to stipulate sight unseen that he is a better programmer than I. Same goes with Akash Mehta - I've got no grudge against personalities and I'll happily say he probably has better programming chops than I do... Lot's of people do!

That out of the way: stop mentioning this crap!

Look - 99% of PHP programmers will never be in a situation where the CPU performance of their code is important. "Slow" applications are network bound, and database bound most of the time and increasing the runtime of your PHP code does not matter! If your web app is running slowly, you can make it run faster by learning to generating less HTTP requests and making fewer datastorage calls (Database or filesystem). Seriously - this is standard wisdom and it cuts across web development platforms (same advice applies to Ruby, Perl, Python, etc). If you are in the 1% (say you're writing a pure PHP bignum library: performance comes from data structures and algorithms. Don't make microbenchmark changes unless you've profiled and proven that they are necessary!)

Think about it - why would we care about these benchmarks? Because we want our code to run faster right? Well no - I only want my code to run faster if it's not running fast enough right now! If it takes .005 seconds to generate a page and the average user takes 1-5 seconds to load it across the network going through my code to gain even a dramatic 100% speedup (more on that in a second) won't change the user experience at all!

So you say - I'm in the 1%! I need to speed up my app! I have a server load in double digits, pages take 30 seconds to render due to CPU load... I gotta have faster running code! Again - refer to above. It is the accepted wisdom of web dev's across languages that the fault is probably not based on micro benchmarks (whether you used while loops or for loops). Check your database indexes and profile all the sql calls you're making. Having the right indexes can change the BigO quality of your queries... And lastly check out caching. Do you really have to calculate every piece of data every time? Memcache is lightning fast and even going to a filesystem Cache system like PEAR's Cache_Lite can dramatically affect performance. Which is better: making your 1000 line's of code run 25% faster at the expense of less readable code or not running the code at all 9 times out of 10 and simply serving out of the cache? (Hint: 1000% &#62; 25%).

Ok - enough ranting about what you should do (ie actual best practices) - here's why you don't care about the micro-benchmarks unless you actually work on the PHP runtime itself. You visit PHPBenchmark.com and see: hey I can speed up my 31% by using double quotes to assign strings rather than single quotes! I should go back through all my old code and make replacements!

No you shouldn't. Single quotes and double quotes mean different things in PHP. Single quotes means &lt;em&gt;No interpolation&lt;/em&gt;! If I see a line like 

&lt;code&gt;
$var = 'some text';
&lt;/code&gt;


it tells me that you won't have special characters like \n, you won't be using $var in the string somewhere. It means something. And no you won't get a 31% speedup - how many lines in your 1000 line codebase are string assignments? 5%? Great you just made 50 changes to get a 1.5% speedup. And of course you used a search and replace and didn't realise that one of those strings contained a $ sign so now you introduced a bug. Oh and in the next point release of the PHP runtime the performance characteristics of the language change and your performance gains are gone.

Get the picture? Language features like foreach($var as $k=&#62;$v) exist because they communicate your intent more precisely and concisely and that is what you should care about as a programmer. Well written program logically structured with clear code? Easy to optimise. Ball of mud with liberal use of microbenchmark best practices? Good luck... Programming is writing for people first (you if nobody else) and computers secondly. CPU time is cheap, programmer time is expensive.

My rant is running out of steam. Let me address Chris and Akash. Chris first - your site is valuable to two groups of people. Yourself (because writing code and completing projects is good for programmers) and the PHP language developers. The only people who should look at micro-benchmarks are the core devs who should be making foreach as fast as while and should be making single quotes as fast as double quotes. For everybody else - this stuff is bikeshedding at best and counterproductive to the inexperienced who don't know better (think about it - beginners read this stuff and don't even know if they have an opcode cache or not). Seriously - put up a big disclaimer at the top of the page directing people looking to make their code run faster to the Wikipedia page on Big O notation. Or at least direct them to useful optimization advice like http://phplens.com/lens/php-book/optimizing-debugging-php.php

And Akash - you write a fine article. But if you want to talk about optimization do the PHP world a favor and write about algorithms, caching options, server (Apache, MySQL) tuning and so on. Teaching people how to run a profiler and actually find out where their code is slow would be useful. If on the other hand you want to write about how to code please don't add to the stream of advice that misses the forest for the trees. Only one of the links you posted was that useful. People write "637 ways to speed up your code" style posts because they're &lt;em&gt;easy&lt;/em&gt;! Don't do easy (and trivial, transient, and useless)- do hard. Do algorithm analysis. Talk about database performance. Look YSlow's list for optimizing the client side. My intent isn't to be mean to anybody and I know it's fun to look at the numbers. Geeks like to argue over minutia. So be it. But don't pretend that it is important or "best practice" and don't confuse newbies who might think that they should pay attention to this stuff...</description>
		<content:encoded><![CDATA[<p>I&#8217;m so happy to see that there is some sanity in the PHP community. @Lachlan and the following posts: you are exactly right! I&#8217;m past being sick of these kind of benchmarks - I&#8217;m pissed that semi-authoritative places like sitepoint link to crap like this and really believe that such benchmarks are counterproductive to the PHP community as a whole.</p>
<p>That&#8217;s a little inflammatory so let me get a few things out of the way. I&#8217;m not knocking Chris Vincent - I&#8217;ve never heard of him and I&#8217;m willing to stipulate sight unseen that he is a better programmer than I. Same goes with Akash Mehta - I&#8217;ve got no grudge against personalities and I&#8217;ll happily say he probably has better programming chops than I do&#8230; Lot&#8217;s of people do!</p>
<p>That out of the way: stop mentioning this crap!</p>
<p>Look - 99% of PHP programmers will never be in a situation where the CPU performance of their code is important. &#8220;Slow&#8221; applications are network bound, and database bound most of the time and increasing the runtime of your PHP code does not matter! If your web app is running slowly, you can make it run faster by learning to generating less HTTP requests and making fewer datastorage calls (Database or filesystem). Seriously - this is standard wisdom and it cuts across web development platforms (same advice applies to Ruby, Perl, Python, etc). If you are in the 1% (say you&#8217;re writing a pure PHP bignum library: performance comes from data structures and algorithms. Don&#8217;t make microbenchmark changes unless you&#8217;ve profiled and proven that they are necessary!)</p>
<p>Think about it - why would we care about these benchmarks? Because we want our code to run faster right? Well no - I only want my code to run faster if it&#8217;s not running fast enough right now! If it takes .005 seconds to generate a page and the average user takes 1-5 seconds to load it across the network going through my code to gain even a dramatic 100% speedup (more on that in a second) won&#8217;t change the user experience at all!</p>
<p>So you say - I&#8217;m in the 1%! I need to speed up my app! I have a server load in double digits, pages take 30 seconds to render due to CPU load&#8230; I gotta have faster running code! Again - refer to above. It is the accepted wisdom of web dev&#8217;s across languages that the fault is probably not based on micro benchmarks (whether you used while loops or for loops). Check your database indexes and profile all the sql calls you&#8217;re making. Having the right indexes can change the BigO quality of your queries&#8230; And lastly check out caching. Do you really have to calculate every piece of data every time? Memcache is lightning fast and even going to a filesystem Cache system like PEAR&#8217;s Cache_Lite can dramatically affect performance. Which is better: making your 1000 line&#8217;s of code run 25% faster at the expense of less readable code or not running the code at all 9 times out of 10 and simply serving out of the cache? (Hint: 1000% &gt; 25%).</p>
<p>Ok - enough ranting about what you should do (ie actual best practices) - here&#8217;s why you don&#8217;t care about the micro-benchmarks unless you actually work on the PHP runtime itself. You visit PHPBenchmark.com and see: hey I can speed up my 31% by using double quotes to assign strings rather than single quotes! I should go back through all my old code and make replacements!</p>
<p>No you shouldn&#8217;t. Single quotes and double quotes mean different things in PHP. Single quotes means <em>No interpolation</em>! If I see a line like </p>
<code>
$var = 'some text';
</code>
<p>it tells me that you won&#8217;t have special characters like \n, you won&#8217;t be using $var in the string somewhere. It means something. And no you won&#8217;t get a 31% speedup - how many lines in your 1000 line codebase are string assignments? 5%? Great you just made 50 changes to get a 1.5% speedup. And of course you used a search and replace and didn&#8217;t realise that one of those strings contained a $ sign so now you introduced a bug. Oh and in the next point release of the PHP runtime the performance characteristics of the language change and your performance gains are gone.</p>
<p>Get the picture? Language features like foreach($var as $k=&gt;$v) exist because they communicate your intent more precisely and concisely and that is what you should care about as a programmer. Well written program logically structured with clear code? Easy to optimise. Ball of mud with liberal use of microbenchmark best practices? Good luck&#8230; Programming is writing for people first (you if nobody else) and computers secondly. CPU time is cheap, programmer time is expensive.</p>
<p>My rant is running out of steam. Let me address Chris and Akash. Chris first - your site is valuable to two groups of people. Yourself (because writing code and completing projects is good for programmers) and the PHP language developers. The only people who should look at micro-benchmarks are the core devs who should be making foreach as fast as while and should be making single quotes as fast as double quotes. For everybody else - this stuff is bikeshedding at best and counterproductive to the inexperienced who don&#8217;t know better (think about it - beginners read this stuff and don&#8217;t even know if they have an opcode cache or not). Seriously - put up a big disclaimer at the top of the page directing people looking to make their code run faster to the Wikipedia page on Big O notation. Or at least direct them to useful optimization advice like <a href="http://phplens.com/lens/php-book/optimizing-debugging-php.php" rel="nofollow">http://phplens.com/lens/php-book/optimizing-debugging-php.php</a></p>
<p>And Akash - you write a fine article. But if you want to talk about optimization do the PHP world a favor and write about algorithms, caching options, server (Apache, MySQL) tuning and so on. Teaching people how to run a profiler and actually find out where their code is slow would be useful. If on the other hand you want to write about how to code please don&#8217;t add to the stream of advice that misses the forest for the trees. Only one of the links you posted was that useful. People write &#8220;637 ways to speed up your code&#8221; style posts because they&#8217;re <em>easy</em>! Don&#8217;t do easy (and trivial, transient, and useless)- do hard. Do algorithm analysis. Talk about database performance. Look YSlow&#8217;s list for optimizing the client side. My intent isn&#8217;t to be mean to anybody and I know it&#8217;s fun to look at the numbers. Geeks like to argue over minutia. So be it. But don&#8217;t pretend that it is important or &#8220;best practice&#8221; and don&#8217;t confuse newbies who might think that they should pay attention to this stuff&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Trent Reimer</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-738800</link>
		<dc:creator>Trent Reimer</dc:creator>
		<pubDate>Tue, 03 Jun 2008 20:02:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-738800</guid>
		<description>The benchmark code is flawed and is giving surprising results accordingly.

But the idea is neat and hopefully the code will be updated.

In one example, a global array variable is set with the name $aHash. The following functions, however, operate on a nonexistent global variable named $x instead. Needless to say the resulting numbers seem quite surprising if you are not aware of the error.

In some cases results appear so far off it leads me to wonder if the site may be mishandling exponents by stripping off the "E" at the end, considerably multiplying the actual value. e.g. treating 5.004E-5 as 5.004

As the previous posters who also took the time to run some of these tests have noted, the site's results do not square.</description>
		<content:encoded><![CDATA[<p>The benchmark code is flawed and is giving surprising results accordingly.</p>
<p>But the idea is neat and hopefully the code will be updated.</p>
<p>In one example, a global array variable is set with the name $aHash. The following functions, however, operate on a nonexistent global variable named $x instead. Needless to say the resulting numbers seem quite surprising if you are not aware of the error.</p>
<p>In some cases results appear so far off it leads me to wonder if the site may be mishandling exponents by stripping off the &#8220;E&#8221; at the end, considerably multiplying the actual value. e.g. treating 5.004E-5 as 5.004</p>
<p>As the previous posters who also took the time to run some of these tests have noted, the site&#8217;s results do not square.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Roetgers</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-738763</link>
		<dc:creator>Mike Roetgers</dc:creator>
		<pubDate>Tue, 03 Jun 2008 18:40:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-738763</guid>
		<description>You don't optimize your page by changing all foreach loops into while loops. Important is the readability of your code and &lt;code&gt;while(list(,$val) = each($aHash))&lt;/code&gt; is no enhancement.
BTW: The benchmark says nothing. I did some testruns on my machine with the provided source code snippets. For example: In my case foreach is winning every time against while.</description>
		<content:encoded><![CDATA[<p>You don&#8217;t optimize your page by changing all foreach loops into while loops. Important is the readability of your code and <code>while(list(,$val) = each($aHash))</code> is no enhancement.<br />
BTW: The benchmark says nothing. I did some testruns on my machine with the provided source code snippets. For example: In my case foreach is winning every time against while.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: turb</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-738601</link>
		<dc:creator>turb</dc:creator>
		<pubDate>Tue, 03 Jun 2008 13:21:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-738601</guid>
		<description>I think that these kind of benchmarks are good to still continue to learn PHP in a proper way. Someone said "Don’t worry about performance until you actually need to..." then I said, good practice at the beginning will save you alot of time in the future.

Even if a tiny details like foreach instead of while loop doesn't change alot a page speed, after one month, it is saving alot. So imagine all those tiny details, at the end, change alot in terms of optimisation.

I am doing some MySQL test these days and I see things with a table of 2 million rows that I do not see with a smaller table. So even if it seem like a waste of time, you end up by learning new technique that you'll replicate in the future.

Why some people hate so much Flash website..... exactly because 'seasoned programmer' code very bad! So telling that it is not important prove the level of professionalism of some people!</description>
		<content:encoded><![CDATA[<p>I think that these kind of benchmarks are good to still continue to learn PHP in a proper way. Someone said &#8220;Don’t worry about performance until you actually need to&#8230;&#8221; then I said, good practice at the beginning will save you alot of time in the future.</p>
<p>Even if a tiny details like foreach instead of while loop doesn&#8217;t change alot a page speed, after one month, it is saving alot. So imagine all those tiny details, at the end, change alot in terms of optimisation.</p>
<p>I am doing some MySQL test these days and I see things with a table of 2 million rows that I do not see with a smaller table. So even if it seem like a waste of time, you end up by learning new technique that you&#8217;ll replicate in the future.</p>
<p>Why some people hate so much Flash website&#8230;.. exactly because &#8217;seasoned programmer&#8217; code very bad! So telling that it is not important prove the level of professionalism of some people!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kailash Badu</title>
		<link>http://www.sitepoint.com/blogs/2008/06/02/phpbench-live-php-benchmarks-best-practices/#comment-738451</link>
		<dc:creator>Kailash Badu</dc:creator>
		<pubDate>Tue, 03 Jun 2008 08:34:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=2522#comment-738451</guid>
		<description>I would concur with everyone who opined that there is no point nitpicking over the issues that simply aren't important in the big picture. The real bottlenecks lay somewhere else.</description>
		<content:encoded><![CDATA[<p>I would concur with everyone who opined that there is no point nitpicking over the issues that simply aren&#8217;t important in the big picture. The real bottlenecks lay somewhere else.</p>]]></content:encoded>
	</item>
</channel>
</rss>
