<?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>[Dot] Code Dump &#187; optimization</title>
	<atom:link href="http://www.dotcodedump.com/tag/optimization/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotcodedump.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 06 Jan 2010 12:27:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Computer Econ 101</title>
		<link>http://www.dotcodedump.com/2009/11/computer-economics-101/</link>
		<comments>http://www.dotcodedump.com/2009/11/computer-economics-101/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 23:02:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[optimization]]></category>
		<category><![CDATA[economics]]></category>
		<category><![CDATA[trade-off]]></category>

		<guid isPermaLink="false">http://www.dotcodedump.com/?p=159</guid>
		<description><![CDATA[Economics at it&#8217;s very heart is the study of production, distribution, and consumption. Computer economics follow the same principals. The computer does very similar things it reads data, writes data, and calculates data. These activities are almost analogous, calculation is production, writing data is distribution, and reading data is consumption. Like real world economies we [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float: left; padding-right: 10px; padding-bottom: 10px;" src="http://mrg.bz/xODbzo" border="0" alt="" width="311" height="302" />Economics at it&#8217;s very heart is the study of production, distribution, and consumption. Computer economics follow the same principals. The computer does very similar things it reads data, writes data, and calculates data. These activities are almost analogous, calculation is production, writing data is distribution, and reading data is consumption. Like real world economies we have fixed resources. We can view our computers as factories, and our programs as work-flows and logistical plans.</p>
<p>Factories in the real world have limits. They only have so many square feet, in which they can fit workers, machines, and resources. Our computers operate under the same principal that we are limited in our resources such as processor speed, RAM, network speed, etc. Part of programming is understanding how to work within these limitations.</p>
<p>Designing and programming applications that operate within the limits requires us to first to know, and then to understand a machines limitations. To know how fast an application will be processed we have to know how much time it will spend reading, writing, and processing.</p>
<p>Moore&#8217;s law has greatly alleviated this problem. We now have bigger, faster, and more efficient computers than we could have ever dreamed of, but that doesn&#8217;t mean we can ignore the bounds. We still need to understand which operations are expensive, reading data from a network location, compared to relatively cheap operations, such as incrementing an integer.</p>
<p>Even though modern computer hardware has greatly increased the resources we use, there are still areas where we must be vigilant. On example is, a web applications running on a server can easily be brought to their knees by a high user load. When developing web applications with a high usage these principals are not just helpful, they are required.</p>
<p>Once you understand the economics of the machine you can start to make intelligent trade offs for resources. One example is caching, a common strategy for reducing processing and data access by keeping a copy of commonly produced data in memory. These trade offs can have impacts, and create issues. Truly understanding the principals behind machine economies is very important.</p>
<p>Even though we should be aware of these principals, it is important to understand the real world trade off of time spent programming, and the need for software to ship. Many times we will release software that not terribly efficient on purpose. Maybe the time to develop was more pressing than performance, may be it is small web application that has a low usage. Whatever the reason we must accept that sometimes we must release software that is just good enough. That doesn&#8217;t mean we can be lazy as programmers, but it means that we should apply the principals of machine economics as we program, and know when we must hand tune our code.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.dotcodedump.com/2009/11/computer-economics-101/&amp;title=Computer+Econ+101" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.dotcodedump.com/2009/11/computer-economics-101/&amp;title=Computer+Econ+101" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http://www.dotcodedump.com/2009/11/computer-economics-101/&amp;title=Computer+Econ+101" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Computer+Econ+101&amp;url=http://www.dotcodedump.com/2009/11/computer-economics-101/&amp;title=Computer+Econ+101" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.dotcodedump.com/2009/11/computer-economics-101/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.dotcodedump.com/2009/11/computer-economics-101/&amp;title=Computer+Econ+101" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.dotcodedump.com/2009/11/computer-economics-101/&amp;title=Computer+Econ+101" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.dotcodedump.com/2009/11/computer-economics-101/&amp;title=Computer+Econ+101" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.dotcodedump.com/2009/11/computer-economics-101/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Computer+Econ+101+@+http://www.dotcodedump.com/2009/11/computer-economics-101/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.dotcodedump.com/2009/11/computer-economics-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimization Is Not Easy</title>
		<link>http://www.dotcodedump.com/2009/03/optimization-is-not-easy/</link>
		<comments>http://www.dotcodedump.com/2009/03/optimization-is-not-easy/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 13:30:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[optimization]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[trade-off]]></category>

		<guid isPermaLink="false">http://blog.lintnernet.com/?p=53</guid>
		<description><![CDATA[
Go to ludicrous speed!

If optimization was easy there would be no slow applications. Slow performance rarely has a single cause.  Depending on the number of causes, optimization is a difficult goal.  Using a consistent, and defined process needs be a critical part of any optimization effort.
&#8220;We should forget about small efficiencies, say about [...]]]></description>
			<content:encoded><![CDATA[<div style="float: left;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_oJ89RnXa3zM/Sa9fan2qNnI/AAAAAAAAAT4/qBVF0jbFgiM/s1600-h/spaceballs6wj.jpg"><img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 191px;" src="http://2.bp.blogspot.com/_oJ89RnXa3zM/Sa9fan2qNnI/AAAAAAAAAT4/qBVF0jbFgiM/s320/spaceballs6wj.jpg" alt="" id="BLOGGER_PHOTO_ID_5309567396672583282" border="0" /></a>
<div style="text-align: center; font-style: italic; font-weight: bold;">Go to ludicrous speed!</div>
</div>
<p>If optimization was easy there would be no slow applications. Slow performance rarely has a single cause.  Depending on the number of causes, optimization is a difficult goal.  Using a consistent, and defined process needs be a critical part of any optimization effort.<br />
<blockquote style="font-style: italic;"><span class="Apple-style-span" style="color: rgb(102, 102, 102);">&#8220;We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. </span><i><span class="Apple-style-span" style="color: rgb(102, 102, 102);">Yet we should not pass up our opportunities in that critical 3%</span></i><span class="Apple-style-span" style="color: rgb(102, 102, 102);">&#8221; -Donald Knuth</span></p></blockquote>
<p> Optimization has a number of side effects, of which we must be aware. During optimization, many times, we must make trade offs. A classic optimization case is, trading processor heavy calculations in favor of using more RAM. Optimizing code can have the unintended effect of making code unreadable, and inflexible.</p>
<p>I mentioned before that Optimization is a difficult goal. I lied. The truth is optimization is not a goal, rather it is a process, also it is best handled as an iterative process.  Using an iterative approach allows you to compare your results, and it gives you a better shot at isolating troubled areas.  The worst approach you can have is to try tackle everything at once, because you will not be able to correlate the results to a specific change.</p>
<p>My personal process for optimization is pretty straightforward:
<ul>
<li>Observe, and Measure</li>
<li>Research</li>
<li>Change</li>
<li>Analyze</li>
<li>Repeat (If Necessary)</li>
</ul>
<p>Once you have a chosen something to optimize the first task is to observe and measure a metric, such as number of operations during a particular action.  Attempt to do some research, as to why a particular section of code.  Once you have your researched as much as you need to, use your best judgment, and make a change you think will have a positive effect.  After making the change analyze whether it performed better than you original measurements, if it did you are on the right path, if not you have just eliminated a potential path.</p>
<p>If you are not happy with the results of a round of iteration.  If you continue the process eventually you will notice that you are seeing diminished returns. A few items can be cherry picked, with a simple rewrite of this procedure.  If optimizing the easiest items do not achieve your goals, then the difficult work will commence.  The same procedure will be followed, but the success rate of the iterations will drop.</p>
<p>Optimization is one of the core group of tasks many developers will need to confront. A consistent, and methodical process will provide a stable foundation to any optimization strategy.  Many times optimization goals may not be met, or will require a significant amount of effort.  Serious optimization does happen, but we must realize that it is not something that just happens, it requires directed, and methodical effort.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/&amp;title=Optimization+Is+Not+Easy" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/&amp;title=Optimization+Is+Not+Easy" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/&amp;title=Optimization+Is+Not+Easy" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Optimization+Is+Not+Easy&amp;url=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/&amp;title=Optimization+Is+Not+Easy" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/&amp;title=Optimization+Is+Not+Easy" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/&amp;title=Optimization+Is+Not+Easy" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/&amp;title=Optimization+Is+Not+Easy" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.dotcodedump.com/2009/03/optimization-is-not-easy/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Optimization+Is+Not+Easy+@+http://www.dotcodedump.com/2009/03/optimization-is-not-easy/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.dotcodedump.com/2009/03/optimization-is-not-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
