<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:series="http://organizeseries.com/"
		>
<channel>
	<title>Comments on: Micro Optimizations That Don&#8217;t Matter</title>
	<atom:link href="http://www.brandonsavage.net/micro-optimizations-that-dont-matter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=micro-optimizations-that-dont-matter</link>
	<description>The personal blog of Brandon Savage. Contains entries of a personal and professional nature focusing on PHP, Apple, LAMP, MySQL and Washington, DC.</description>
	<lastBuildDate>Wed, 15 May 2013 14:54:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.2-alpha</generator>
	<item>
		<title>By: Richard Lynch</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1761</link>
		<dc:creator>Richard Lynch</dc:creator>
		<pubDate>Wed, 28 Oct 2009 05:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1761</guid>
		<description><![CDATA[I thought rand() was gutted and replaced with mt_rand() under the hood anyway...

Also, I&#039;m not sure why anybody thinks &quot;&quot; is parsed &quot;more&quot; than &#039;&#039;...

Both have escape characters, so PHP has to iterate through the string for each, looking for \\ and \&#039; in one, and a whole host of things in the other, including, but not limited to: {} $ \&quot; and a bunch of other backslash stuff that I won&#039;t duplicate here when you can rtfm.

Maybe PHP has to go through &quot;twice&quot; for &quot;&quot;, but I sure don&#039;t see why...

It&#039;s still silly to try to optimize where your bottleneck isn&#039;t.

Build it simple/straightforward first, then find bottlenecks and figure out why it&#039;s slow, and ONLY then can you begin to optimize.]]></description>
		<content:encoded><![CDATA[<p>I thought rand() was gutted and replaced with mt_rand() under the hood anyway&#8230;</p>
<p>Also, I&#8217;m not sure why anybody thinks &#8220;&#8221; is parsed &#8220;more&#8221; than &#8221;&#8230;</p>
<p>Both have escape characters, so PHP has to iterate through the string for each, looking for \\ and \&#8217; in one, and a whole host of things in the other, including, but not limited to: {} $ \&#8221; and a bunch of other backslash stuff that I won&#8217;t duplicate here when you can rtfm.</p>
<p>Maybe PHP has to go through &#8220;twice&#8221; for &#8220;&#8221;, but I sure don&#8217;t see why&#8230;</p>
<p>It&#8217;s still silly to try to optimize where your bottleneck isn&#8217;t.</p>
<p>Build it simple/straightforward first, then find bottlenecks and figure out why it&#8217;s slow, and ONLY then can you begin to optimize.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre Spring</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1757</link>
		<dc:creator>Pierre Spring</dc:creator>
		<pubDate>Tue, 27 Oct 2009 22:14:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1757</guid>
		<description><![CDATA[There is one advantage about these micro optimizations: Coding Standards. You have arguments to enforce some coding standards within communities and enterprises. I, for example, don&#039;t like it, when I see double and single quotes mixed within the same ligne of concatenation ...]]></description>
		<content:encoded><![CDATA[<p>There is one advantage about these micro optimizations: Coding Standards. You have arguments to enforce some coding standards within communities and enterprises. I, for example, don&#8217;t like it, when I see double and single quotes mixed within the same ligne of concatenation &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clay</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1746</link>
		<dc:creator>Clay</dc:creator>
		<pubDate>Tue, 27 Oct 2009 01:55:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1746</guid>
		<description><![CDATA[The key is don’t optimize blindly, and consider the tradeoffs that are inherent.

@Greg Beaver : Absolutely agree with that.]]></description>
		<content:encoded><![CDATA[<p>The key is don’t optimize blindly, and consider the tradeoffs that are inherent.</p>
<p>@Greg Beaver : Absolutely agree with that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Beaver</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1744</link>
		<dc:creator>Greg Beaver</dc:creator>
		<pubDate>Mon, 26 Oct 2009 17:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1744</guid>
		<description><![CDATA[First off, I agree 100% that micro-optimizations may not matter at all to your application.

However, I&#039;d like to point out that you have oversimplified the question of how to load external files and how it affects performance.  In Rasmus Lerdorf&#039;s keynote for Drupalcon last year (http://szeged2008.drupalcon.org/program/sessions/rasmus-lerdorf-keynote-simple-hard) he took a simple application and through a series of optimizations, some micro, some more substantial, transformed it from an application that can handle 13 req/sec to one that does 400 req/sec as measured by Apache benchmark.

One of the more significant improvements came simply from changing include_path from &quot;.:/path/to/stuff&quot; to &quot;/path/to/stuff:.&quot;  This is certainly a micro-optimization by any definition.  Also, by replacing require_once with include, he increased the requests per second (note: not the percentage of execution time, the actual number of requests that can be served per second) by a large percentage.

So, this is all to say, micro-optimizations are sometimes useless, but when you do them in conjunction with a real application, and measure the difference in requests per second, you can get an accurate picture of how much they help, and they can result in several thousands of percentage increase in performance for the application as a whole.

The key is don&#039;t optimize blindly, and consider the tradeoffs that are inherent.]]></description>
		<content:encoded><![CDATA[<p>First off, I agree 100% that micro-optimizations may not matter at all to your application.</p>
<p>However, I&#8217;d like to point out that you have oversimplified the question of how to load external files and how it affects performance.  In Rasmus Lerdorf&#8217;s keynote for Drupalcon last year (<a href="http://szeged2008.drupalcon.org/program/sessions/rasmus-lerdorf-keynote-simple-hard" rel="nofollow">http://szeged2008.drupalcon.org/program/sessions/rasmus-lerdorf-keynote-simple-hard</a>) he took a simple application and through a series of optimizations, some micro, some more substantial, transformed it from an application that can handle 13 req/sec to one that does 400 req/sec as measured by Apache benchmark.</p>
<p>One of the more significant improvements came simply from changing include_path from &#8220;.:/path/to/stuff&#8221; to &#8220;/path/to/stuff:.&#8221;  This is certainly a micro-optimization by any definition.  Also, by replacing require_once with include, he increased the requests per second (note: not the percentage of execution time, the actual number of requests that can be served per second) by a large percentage.</p>
<p>So, this is all to say, micro-optimizations are sometimes useless, but when you do them in conjunction with a real application, and measure the difference in requests per second, you can get an accurate picture of how much they help, and they can result in several thousands of percentage increase in performance for the application as a whole.</p>
<p>The key is don&#8217;t optimize blindly, and consider the tradeoffs that are inherent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giorgio Sironi</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1742</link>
		<dc:creator>Giorgio Sironi</dc:creator>
		<pubDate>Mon, 26 Oct 2009 16:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1742</guid>
		<description><![CDATA[Agree on all the points, Brandon.]]></description>
		<content:encoded><![CDATA[<p>Agree on all the points, Brandon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: till</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1738</link>
		<dc:creator>till</dc:creator>
		<pubDate>Mon, 26 Oct 2009 08:55:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1738</guid>
		<description><![CDATA[Hey,

so on the absolute path issue, two things:

a) Did you toy with the realpath cache (and ttl) at all? It helps you somewhat if you jack up the values, etc.. Generally this works well in a production environment when the application only changes with a new deployment.

b) For the &quot;makes code unportable&quot; issue. This is something you can actually take care of in deployment. For example, PEAR has those nifty @foo@ identifiers which can be replaced with a replacement task. So for example, @php_bin@ becomes /whereever/php-cli/is/located. This depends on PEAR&#039;s configuration (which should be taken care of when you set it up/install it).

Nice writing!]]></description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>so on the absolute path issue, two things:</p>
<p>a) Did you toy with the realpath cache (and ttl) at all? It helps you somewhat if you jack up the values, etc.. Generally this works well in a production environment when the application only changes with a new deployment.</p>
<p>b) For the &#8220;makes code unportable&#8221; issue. This is something you can actually take care of in deployment. For example, PEAR has those nifty @foo@ identifiers which can be replaced with a replacement task. So for example, @php_bin@ becomes /whereever/php-cli/is/located. This depends on PEAR&#8217;s configuration (which should be taken care of when you set it up/install it).</p>
<p>Nice writing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samuel Folkes</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1737</link>
		<dc:creator>Samuel Folkes</dc:creator>
		<pubDate>Mon, 26 Oct 2009 08:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1737</guid>
		<description><![CDATA[I read the article you&#039;re rebutting a while back and chuckled to myself, particularly after reading the part about obtaining a timestamp. The concept of micro-optimization is easy to sell, particularly because people are generally more concerned with getting a quick fix than learning how to write code properly In the first place. I agree with almost all you say here. As far as echo() and print() are concerned, I agree that the speed difference gained from using echo() is negligible, however the reason print() is slower is not because its a function. They&#039;re both language constructs but print() is slower because unlike echo() it returns a value; &#039;1&#039; if the argument is successfully printed and &#039;0&#039; if it isn&#039;t.]]></description>
		<content:encoded><![CDATA[<p>I read the article you&#8217;re rebutting a while back and chuckled to myself, particularly after reading the part about obtaining a timestamp. The concept of micro-optimization is easy to sell, particularly because people are generally more concerned with getting a quick fix than learning how to write code properly In the first place. I agree with almost all you say here. As far as echo() and print() are concerned, I agree that the speed difference gained from using echo() is negligible, however the reason print() is slower is not because its a function. They&#8217;re both language constructs but print() is slower because unlike echo() it returns a value; &#8217;1&#8242; if the argument is successfully printed and &#8217;0&#8242; if it isn&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonas Lejon</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1736</link>
		<dc:creator>Jonas Lejon</dc:creator>
		<pubDate>Mon, 26 Oct 2009 07:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1736</guid>
		<description><![CDATA[Don&#039;t forget about rand() vs mt_rand(). Some people puts the slow rand() inside a loop etc]]></description>
		<content:encoded><![CDATA[<p>Don&#8217;t forget about rand() vs mt_rand(). Some people puts the slow rand() inside a loop etc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clay</title>
		<link>http://www.brandonsavage.net/micro-optimizations-that-dont-matter/#comment-1733</link>
		<dc:creator>Clay</dc:creator>
		<pubDate>Mon, 26 Oct 2009 06:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=907#comment-1733</guid>
		<description><![CDATA[Well, since you linked to my article, i might as well leave a comment on your blog. 

Well, on the loop case. I did not said that loop or nested loop isn&#039;t part of programming. I&#039;m just stating the efficiency cost of having too much nested loop. Definitely if you use it right (which is not like 4-10 nested loops) it really doesn&#039;t bother anyone when looking at how powerful computers are nowadays. And in case you know everything. Not EVERYONE does. Furthermore, the link you provided is a bit static, try looking for one that provides a more dynamic result to test on different OS? Nonetheless, its a good references to check it out :)

Single vs Double quote. Well done on spending your time on benchmarking (when there are already real time sites doing it). Anyway, if you really want to do a benchmark on the sentence i wrote, try doing it with a double quote with a variable string embed within it. But this is micro optimization, i believe you won&#039;t be interested with micro optimization. 

pre vs post increment. 5% can also mean 0.0000001ms compare to 0.00000001ms. Like you said, it really doesn&#039;t matter.

echo vs print. it really DOESN&#039;T MATTER.

etc....

anyway, I&#039;m just interested with the benchmarking of MICRO OPTIMIZATION and sort of good to know such differences as a programmer although you don&#039;t since it doesn&#039;t provide any benefit to you. But i do agree with you that micro optimization doesn&#039;t help optimize performance big time. May be you odd to read the comment i left on that post before spending the time writing this?]]></description>
		<content:encoded><![CDATA[<p>Well, since you linked to my article, i might as well leave a comment on your blog. </p>
<p>Well, on the loop case. I did not said that loop or nested loop isn&#8217;t part of programming. I&#8217;m just stating the efficiency cost of having too much nested loop. Definitely if you use it right (which is not like 4-10 nested loops) it really doesn&#8217;t bother anyone when looking at how powerful computers are nowadays. And in case you know everything. Not EVERYONE does. Furthermore, the link you provided is a bit static, try looking for one that provides a more dynamic result to test on different OS? Nonetheless, its a good references to check it out :)</p>
<p>Single vs Double quote. Well done on spending your time on benchmarking (when there are already real time sites doing it). Anyway, if you really want to do a benchmark on the sentence i wrote, try doing it with a double quote with a variable string embed within it. But this is micro optimization, i believe you won&#8217;t be interested with micro optimization. </p>
<p>pre vs post increment. 5% can also mean 0.0000001ms compare to 0.00000001ms. Like you said, it really doesn&#8217;t matter.</p>
<p>echo vs print. it really DOESN&#8217;T MATTER.</p>
<p>etc&#8230;.</p>
<p>anyway, I&#8217;m just interested with the benchmarking of MICRO OPTIMIZATION and sort of good to know such differences as a programmer although you don&#8217;t since it doesn&#8217;t provide any benefit to you. But i do agree with you that micro optimization doesn&#8217;t help optimize performance big time. May be you odd to read the comment i left on that post before spending the time writing this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced (User agent is rejected)
Object Caching 567/578 objects using apc
Content Delivery Network via Amazon Web Services: S3: brandonsavage-net-files.s3.amazonaws.com

 Served from: www.brandonsavage.net @ 2013-05-19 00:38:00 by W3 Total Cache -->