<?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 Speed Optimizations</title>
	<atom:link href="http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<pubDate>Tue, 02 Dec 2008 07:08:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Sandy Smith</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1951</link>
		<dc:creator>Sandy Smith</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1951</guid>
		<description>&lt;p&gt;I've heard the "hardware is cheap" argument several times, and for those outsourcing programming to an outside firm that requires cash payments for every hour worked, it may hold some water.&lt;/p&gt;

&lt;p&gt;However, at no place I've ever worked at has such an issue been met regularly with "buy more/better/faster hardware". Let's look at it from the perspective of the manager:&lt;/p&gt;

&lt;p&gt;1) You are a salaried employee. You have a fixed cost whether you are utilized or not. You also can be made to work overtime. Optimization is more work for you.&lt;br /&gt;
2) Hardware is not a fix cost and must be budgeted and planned for, over and above your salary. It also requires, on live products, very careful planning to oversee the transition. More work for the manager.&lt;/p&gt;

&lt;p&gt;Is it any wonder that you get pressured to optimize even in cases where an economist would suggest the pareto for the organization is deploying your talents to new business and additional cash to hardware?&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>I&#8217;ve heard the &#8220;hardware is cheap&#8221; argument several times, and for those outsourcing programming to an outside firm that requires cash payments for every hour worked, it may hold some water.</p>
<p>However, at no place I&#8217;ve ever worked at has such an issue been met regularly with &#8220;buy more/better/faster hardware&#8221;. Let&#8217;s look at it from the perspective of the manager:</p>
<p>1) You are a salaried employee. You have a fixed cost whether you are utilized or not. You also can be made to work overtime. Optimization is more work for you.<br />
2) Hardware is not a fix cost and must be budgeted and planned for, over and above your salary. It also requires, on live products, very careful planning to oversee the transition. More work for the manager.</p>
<p>Is it any wonder that you get pressured to optimize even in cases where an economist would suggest the pareto for the organization is deploying your talents to new business and additional cash to hardware?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Anton</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1952</link>
		<dc:creator>Matt Anton</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1952</guid>
		<description>&lt;p&gt;Check out this Benchmarking article, "Benchmarking PHP with no BS", by John Lim: http://www.phpmag.net/itr/online_artikel/psecom,id,546,nodeid,114.html&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Check out this Benchmarking article, &#8220;Benchmarking PHP with no BS&#8221;, by John Lim: <a href="http://www.phpmag.net/itr/online_artikel/psecom,id,546,nodeid,114.html" rel="nofollow">http://www.phpmag.net/itr/online_artikel/psecom,id,546,nodeid,114.html</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: trigger</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1953</link>
		<dc:creator>trigger</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1953</guid>
		<description>&lt;p&gt;awesome post! I always wonder what ways I can optimize PHP without rejiggering my whole app. I would love to hear about little PHP tricks that would provide those sort of 16% performance upgrades.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>awesome post! I always wonder what ways I can optimize PHP without rejiggering my whole app. I would love to hear about little PHP tricks that would provide those sort of 16% performance upgrades.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Wormus</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1954</link>
		<dc:creator>Aaron Wormus</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1954</guid>
		<description>&lt;p&gt;Trigger, it's not like by replacing double quotes with single quotes your script will magically get 16% faster. It just means that instead of taking PHP 0.00012 seconds to parse a string it will take 0.0001 seconds (fuzzy math), and in a non-benchmark scenario will probably not even make a measurable difference.&lt;/p&gt;

&lt;p&gt;If you're looking to speed up a sluggish script, your style of quoting is pretty far down on the list of priorities. &lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Trigger, it&#8217;s not like by replacing double quotes with single quotes your script will magically get 16% faster. It just means that instead of taking PHP 0.00012 seconds to parse a string it will take 0.0001 seconds (fuzzy math), and in a non-benchmark scenario will probably not even make a measurable difference.</p>
<p>If you&#8217;re looking to speed up a sluggish script, your style of quoting is pretty far down on the list of priorities. </p>]]></content:encoded>
	</item>
	<item>
		<title>By: TheArgh</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1955</link>
		<dc:creator>TheArgh</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1955</guid>
		<description>&lt;p&gt;Even if the performance gain is as you say 'negligible', it nevertheless is a performance gain that can get interesting when scaled to larger applications. It's not the main focus, of cours, but it can help nevertheless.&lt;/p&gt;

&lt;p&gt;I have taken a habit of quoting with single quotes, and thus don't even have to bother about it anymore.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Even if the performance gain is as you say &#8216;negligible&#8217;, it nevertheless is a performance gain that can get interesting when scaled to larger applications. It&#8217;s not the main focus, of cours, but it can help nevertheless.</p>
<p>I have taken a habit of quoting with single quotes, and thus don&#8217;t even have to bother about it anymore.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Nico Edtinger</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1956</link>
		<dc:creator>Nico Edtinger</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1956</guid>
		<description>&lt;p&gt;John Lim does not say single quotes are not faster than double quotes. His examples has quotes and concat. But if your string has no special chars or variables, i.e. an array key, single keys are faster.&lt;/p&gt;

&lt;p&gt;Still most people shouldn't care, because so many other things in their code can be optimized. But there's no simple how-to for that. A profiler could help. Maybe you could do an article about Zend Studio and Xdebug and stuff to tell your readers something about profiling.&lt;/p&gt;

&lt;p&gt;b4n&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>John Lim does not say single quotes are not faster than double quotes. His examples has quotes and concat. But if your string has no special chars or variables, i.e. an array key, single keys are faster.</p>
<p>Still most people shouldn&#8217;t care, because so many other things in their code can be optimized. But there&#8217;s no simple how-to for that. A profiler could help. Maybe you could do an article about Zend Studio and Xdebug and stuff to tell your readers something about profiling.</p>
<p>b4n</p>]]></content:encoded>
	</item>
	<item>
		<title>By: George Schlossnagle</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1957</link>
		<dc:creator>George Schlossnagle</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1957</guid>
		<description>&lt;p&gt;If you're serious about performance you should be using a compiler cache anyway, in which case this parse overhead (which is so miniscule as to make the cost of implementing it greater than the benefit in likely all cases) is removed.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>If you&#8217;re serious about performance you should be using a compiler cache anyway, in which case this parse overhead (which is so miniscule as to make the cost of implementing it greater than the benefit in likely all cases) is removed.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Buddha443556</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1958</link>
		<dc:creator>Buddha443556</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1958</guid>
		<description>&lt;p&gt;I don't work on many dedicated servers. My clients are small businesses with shared hosting accounts mostly or VPS at best. I don't find PHP to be my bottleneck but the hard drive. Throwing hardware at the problem or even implementing a software solution like compiler cache is not an option. I have to work with the resources available and make the best of them.&lt;/p&gt;

&lt;p&gt;IMHO optimization should start with design before a single line of code is written. Understanding the underlying architecture and how PHP fits into that architecture is fundamental to a good design.&lt;/p&gt;

&lt;p&gt;JMHO.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>I don&#8217;t work on many dedicated servers. My clients are small businesses with shared hosting accounts mostly or VPS at best. I don&#8217;t find PHP to be my bottleneck but the hard drive. Throwing hardware at the problem or even implementing a software solution like compiler cache is not an option. I have to work with the resources available and make the best of them.</p>
<p>IMHO optimization should start with design before a single line of code is written. Understanding the underlying architecture and how PHP fits into that architecture is fundamental to a good design.</p>
<p>JMHO.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dean C</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1959</link>
		<dc:creator>Dean C</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1959</guid>
		<description>&lt;p&gt;It's always interesting to read things like this. Thanks for the links to the article!&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>It&#8217;s always interesting to read things like this. Thanks for the links to the article!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jaxn</title>
		<link>http://www.sitepoint.com/blogs/2005/03/07/php-speed-optimizations/#comment-1960</link>
		<dc:creator>Jaxn</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">505111231#comment-1960</guid>
		<description>&lt;p&gt;I always use single quotes when there are no variables.  When there are variables within the quoted string then I place those within curly braces.  My understanding is that the parser can parse the variables within the string faster if they are in curly braces (and accessing array members is simplier too).&lt;/p&gt;

&lt;p&gt;ex:&lt;br /&gt;
$foo = 'just a string';&lt;/p&gt;

&lt;p&gt;$bar['test'] = "This is a string that is not {$foo}";&lt;/p&gt;

&lt;p&gt;$baz = "Let's dig deep to find {$bar['test']}";&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
I think it is a good habbit to have, but I wouldn't go back and change to this style as an optimization technique.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>I always use single quotes when there are no variables.  When there are variables within the quoted string then I place those within curly braces.  My understanding is that the parser can parse the variables within the string faster if they are in curly braces (and accessing array members is simplier too).</p>
<p>ex:<br />
$foo = &#8216;just a string&#8217;;</p>
<p>$bar[&#8217;test&#8217;] = &#8220;This is a string that is not {$foo}&#8221;;</p>
<p>$baz = &#8220;Let&#8217;s dig deep to find {$bar[&#8217;test&#8217;]}&#8221;;</p>
<p>
I think it is a good habbit to have, but I wouldn&#8217;t go back and change to this style as an optimization technique.</p>]]></content:encoded>
	</item>
</channel>
</rss>
