<?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: PHP Performance Best Practices</title>
	<atom:link href="http://atomized.org/2005/04/php-performance-best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://atomized.org/2005/04/php-performance-best-practices/</link>
	<description>Fragmenting reality.</description>
	<pubDate>Tue, 06 Jan 2009 05:34:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Ian</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-94064</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Wed, 30 Jul 2008 21:18:28 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-94064</guid>
		<description>@James, If you have 30k LOC in one file, your concerns should be about the maintainability of your application, not performance.

Taking a speed hit in exchange for maintainability gains is a good trade-off. CPU cycles are cheap and only getting cheaper. Developer cycles are expensive and getting more so.</description>
		<content:encoded><![CDATA[<p>@James, If you have 30k LOC in one file, your concerns should be about the maintainability of your application, not performance.</p>
<p>Taking a speed hit in exchange for maintainability gains is a good trade-off. CPU cycles are cheap and only getting cheaper. Developer cycles are expensive and getting more so.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Rusev Blog about web development and graphic design &#187; Blog Archive &#187; PHP performance tips around the web</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-93940</link>
		<dc:creator>Martin Rusev Blog about web development and graphic design &#187; Blog Archive &#187; PHP performance tips around the web</dc:creator>
		<pubDate>Tue, 29 Jul 2008 08:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-93940</guid>
		<description>[...] http://atomized.org/2005/04/php-performance-best-practices/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://atomized.org/2005/04/php-performance-best-practices/" rel="nofollow">http://atomized.org/2005/04/php-performance-best-practices/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-93893</link>
		<dc:creator>James</dc:creator>
		<pubDate>Mon, 28 Jul 2008 19:57:19 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-93893</guid>
		<description>been looking around the web for a good article on performance tuning.

I have a script that is approximately 30,000 lines long (it's a simulator)... I've recently begun to hack out logical pieces of the script and place them in separate files... as the script will run, it will include whatever applicable file is needed at that time.

I've read that having a massive number of includes can actually reduce performance due to file I/O delays.

At what point do the delays from the includes start to outweigh the parse time of a single large script?</description>
		<content:encoded><![CDATA[<p>been looking around the web for a good article on performance tuning.</p>
<p>I have a script that is approximately 30,000 lines long (it&#8217;s a simulator)&#8230; I&#8217;ve recently begun to hack out logical pieces of the script and place them in separate files&#8230; as the script will run, it will include whatever applicable file is needed at that time.</p>
<p>I&#8217;ve read that having a massive number of includes can actually reduce performance due to file I/O delays.</p>
<p>At what point do the delays from the includes start to outweigh the parse time of a single large script?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kvz</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-66151</link>
		<dc:creator>kvz</dc:creator>
		<pubDate>Sat, 06 Oct 2007 16:03:30 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-66151</guid>
		<description>Another article about optimizing the performance of apache &#38; php for high traffic loads:
http://kevin.vanzonneveld.net/techblog/article/survive_heavy_traffic_with_your_webserver</description>
		<content:encoded><![CDATA[<p>Another article about optimizing the performance of apache &amp; php for high traffic loads:<br />
<a href="http://kevin.vanzonneveld.net/techblog/article/survive_heavy_traffic_with_your_webserver" rel="nofollow">http://kevin.vanzonneveld.net/techblog/article/survive_heavy_traffic_with_your_webserver</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TruePath</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-56512</link>
		<dc:creator>TruePath</dc:creator>
		<pubDate>Mon, 25 Jun 2007 22:00:16 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-56512</guid>
		<description>So long as you aren't modifying the arrays passing by reference shouldn't be any faster.  It is my understanding (from a comment posted in the PHP manual on references) that internally php always passes/assigns by reference adding appropriate copy on write flags so data can masquerade as a copy.

In any case it is far from clear that passing by reference results in better performance *unless* you want to modify the values in the array and have those changes show up in two places.</description>
		<content:encoded><![CDATA[<p>So long as you aren&#8217;t modifying the arrays passing by reference shouldn&#8217;t be any faster.  It is my understanding (from a comment posted in the PHP manual on references) that internally php always passes/assigns by reference adding appropriate copy on write flags so data can masquerade as a copy.</p>
<p>In any case it is far from clear that passing by reference results in better performance *unless* you want to modify the values in the array and have those changes show up in two places.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Eure</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-34204</link>
		<dc:creator>Ian Eure</dc:creator>
		<pubDate>Tue, 06 Mar 2007 19:37:33 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-34204</guid>
		<description>Hans,
Thanks for the feedback. I ran these tests a while back, and have not re-run them with PHP 5. The situation with some of these items has changed; for example, PHP 5 supports foreach by reference, which PHP 4 did not. The variability of these factors is precisely why I implore people to test different scenarios to find the best balance for their use-case.

You’re absolutely right that there is a trade-off of clarity vs. speed for string operations. It’s an individual choice as to whether it’s a win or not.</description>
		<content:encoded><![CDATA[<p>Hans,<br />
Thanks for the feedback. I ran these tests a while back, and have not re-run them with PHP 5. The situation with some of these items has changed; for example, PHP 5 supports foreach by reference, which PHP 4 did not. The variability of these factors is precisely why I implore people to test different scenarios to find the best balance for their use-case.</p>
<p>You’re absolutely right that there is a trade-off of clarity vs. speed for string operations. It’s an individual choice as to whether it’s a win or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Duedal</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-34158</link>
		<dc:creator>Hans Duedal</dc:creator>
		<pubDate>Tue, 06 Mar 2007 10:13:35 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-34158</guid>
		<description>My studies of "string concatenation instead of sprintf()" show a 20% performance increase in favor of string concatenation. Not 100% as you mentioned. I many cases I would prefer sprintf for the clarity the syntax provides when the speed increase is no more than in average 20%.
This is testet on PHP 5.2.1 running in CLI mode on Ubuntu.</description>
		<content:encoded><![CDATA[<p>My studies of &#8220;string concatenation instead of sprintf()&#8221; show a 20% performance increase in favor of string concatenation. Not 100% as you mentioned. I many cases I would prefer sprintf for the clarity the syntax provides when the speed increase is no more than in average 20%.<br />
This is testet on PHP 5.2.1 running in CLI mode on Ubuntu.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LeoTech &#187; Blog Archive &#187; Javascript Smorgasboard</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-31130</link>
		<dc:creator>LeoTech &#187; Blog Archive &#187; Javascript Smorgasboard</dc:creator>
		<pubDate>Thu, 08 Feb 2007 20:40:26 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-31130</guid>
		<description>[...] In addition to the PHP Performance link from yesterday, I just added four related to Javascript to the sidebar. [...]</description>
		<content:encoded><![CDATA[<p>[...] In addition to the PHP Performance link from yesterday, I just added four related to Javascript to the sidebar. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TechnoPetr &#187; Blog Archive &#187; PHP Smorgasboard</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-30637</link>
		<dc:creator>TechnoPetr &#187; Blog Archive &#187; PHP Smorgasboard</dc:creator>
		<pubDate>Mon, 05 Feb 2007 16:50:26 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-30637</guid>
		<description>[...] Atomized &#124; PHP Performance Best Practices [...]</description>
		<content:encoded><![CDATA[<p>[...] Atomized | PHP Performance Best Practices [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Eure</title>
		<link>http://atomized.org/2005/04/php-performance-best-practices/#comment-302</link>
		<dc:creator>Ian Eure</dc:creator>
		<pubDate>Sun, 30 Oct 2005 00:04:05 +0000</pubDate>
		<guid isPermaLink="false">http://atomized.org/2005/04/php-performance-checklist/#comment-302</guid>
		<description>&lt;i&gt;"Single-quotes aren’t really any faster than double-quotes. That’s a myth."&lt;/i&gt;
No, it's a myth that they are significantly faster, which I don't claim.

&lt;i&gt;"So if you actually benchmark these, you’re not going to find much different between ‘’ and “” for any real-world situation where both are appropriate."&lt;/i&gt;
You're right - there isn't much difference, but single quotes are &lt;i&gt;slightly&lt;/i&gt; faster. I ran some comparative tests a while back - I suppose the situation may have changed with PHP 4.4.0/5, but it was faster at the time.

And why use double-quotes if you don't need to parse variables in the string anyways? I see this as akin to using preg_match() or ereg() where a strstr() would work just as well. If you don't need all the features something offers, why use something that offers them and is slower, even if only very slightly so?

I do mention that you should profile your code. Anyone who tries to optimize without examining the impact will not get good results. None of this stuff is absolute; everything depends on your setup. Perhaps I should have stressed that more.</description>
		<content:encoded><![CDATA[<p><i>&#8220;Single-quotes aren’t really any faster than double-quotes. That’s a myth.&#8221;</i><br />
No, it&#8217;s a myth that they are significantly faster, which I don&#8217;t claim.</p>
<p><i>&#8220;So if you actually benchmark these, you’re not going to find much different between ‘’ and “” for any real-world situation where both are appropriate.&#8221;</i><br />
You&#8217;re right - there isn&#8217;t much difference, but single quotes are <i>slightly</i> faster. I ran some comparative tests a while back - I suppose the situation may have changed with PHP 4.4.0/5, but it was faster at the time.</p>
<p>And why use double-quotes if you don&#8217;t need to parse variables in the string anyways? I see this as akin to using preg_match() or ereg() where a strstr() would work just as well. If you don&#8217;t need all the features something offers, why use something that offers them and is slower, even if only very slightly so?</p>
<p>I do mention that you should profile your code. Anyone who tries to optimize without examining the impact will not get good results. None of this stuff is absolute; everything depends on your setup. Perhaps I should have stressed that more.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
