<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Developer Day &#187; Optimization</title>
	<atom:link href="http://www.thedeveloperday.com/tag/optimization/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedeveloperday.com</link>
	<description>Staying Curious</description>
	<lastBuildDate>Tue, 27 Jul 2010 17:33:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MySQL &#8211; ORDER BY RAND() optimization</title>
		<link>http://www.thedeveloperday.com/mysql-order-by-rand-optimization/</link>
		<comments>http://www.thedeveloperday.com/mysql-order-by-rand-optimization/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 11:44:46 +0000</pubDate>
		<dc:creator>Žilvinas Šaltys</dc:creator>
				<category><![CDATA[Lazyweb]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[randomization]]></category>
		<category><![CDATA[sorting]]></category>

		<guid isPermaLink="false">http://www.thedeveloperday.com/mysql-order-by-rand-optimization/</guid>
		<description><![CDATA[Interesting read about order by rand optimization by Jan Kneschke. Haven&#8217;t used this myself but seems might be rather useful. The performance difference is huge. I wonder if MySQL could optimize ORDER BY RAND() itself when there are no data holes.]]></description>
			<content:encoded><![CDATA[<p>Interesting read about <a href="http://jan.kneschke.de/projects/mysql/order-by-rand/" title="mysql order by RAND() optimization">order by rand optimization</a> by <a href="http://jan.kneschke.de/" title="jan kneschke">Jan Kneschke</a>. Haven&#8217;t used this myself but seems might be rather useful. The performance difference is huge. I wonder if MySQL could optimize ORDER BY RAND() itself when there are no data holes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedeveloperday.com/mysql-order-by-rand-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP lazy copy or copy on write</title>
		<link>http://www.thedeveloperday.com/php-lazy-copy/</link>
		<comments>http://www.thedeveloperday.com/php-lazy-copy/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 21:59:14 +0000</pubDate>
		<dc:creator>Žilvinas Šaltys</dc:creator>
				<category><![CDATA[Optimization]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[copy-on-write]]></category>
		<category><![CDATA[lazy-copy]]></category>

		<guid isPermaLink="false">http://www.thedeveloperday.com/php-lazy-copy/</guid>
		<description><![CDATA[Here&#8217;s an interesting question from the Zend exam practice test: &#8220;Absent any actual need for choosing one method over the other, does passing arrays by value to a read-only function reduce performance compared to passing them by reference?&#8217; I wondered well PHP would have to make a copy of the variable passed so that would [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an interesting question from the Zend exam practice test:</p>
<blockquote><p>&#8220;Absent any actual need for choosing one method over the other, does passing arrays by value to a read-only function reduce performance compared to passing them by reference?&#8217;</p></blockquote>
<p>I wondered well PHP would have to make a copy of the variable passed so that would be slower than passing it by reference. I was wrong. Turns out PHP uses a lazy-copy mechanism (also called copy-on-write) that does not actually create a copy of a variable until it is modified. And since PHP must create a set of structures that it uses to maintain the reference it is actually &#8220;slower&#8221; to pass a variable to a read-only function by reference.</p>
<p>Having programmed for quite a few years I could have thought of that myself. Strangely this was not in the study guide.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedeveloperday.com/php-lazy-copy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
