<?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: JavaScript&#160;Optimization</title>
	<atom:link href="http://particletree.com/notebook/javascript-optimization/feed/" rel="self" type="application/rss+xml" />
	<link>http://particletree.com/notebook/javascript-optimization/</link>
	<description>Everyone needs a hug.</description>
	<pubDate>Wed, 08 Oct 2008 05:34:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Ryan Campbell</title>
		<link>http://particletree.com/notebook/javascript-optimization/#comment-1367</link>
		<dc:creator>Ryan Campbell</dc:creator>
		<pubDate>Tue, 13 Dec 2005 16:36:37 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=163#comment-1367</guid>
		<description>&lt;p&gt;Dean - It has definitely got me thinking.&lt;/p&gt;

&lt;p&gt;Wesley - That is the approach I often take, but the problem I run into is that I rarely come back for the optimization part. This is mainly because when I am learning or testing personal projects they are done on localhost with no users except myself. I wonder if writing optimized code from project to project would eventually make it so commonplace that it was the natural way of thinking instead of being a time sucking distraction.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dean - It has definitely got me thinking.</p>

<p>Wesley - That is the approach I often take, but the problem I run into is that I rarely come back for the optimization part. This is mainly because when I am learning or testing personal projects they are done on localhost with no users except myself. I wonder if writing optimized code from project to project would eventually make it so commonplace that it was the natural way of thinking instead of being a time sucking distraction.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Wesley Walser</title>
		<link>http://particletree.com/notebook/javascript-optimization/#comment-1366</link>
		<dc:creator>Wesley Walser</dc:creator>
		<pubDate>Tue, 13 Dec 2005 10:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=163#comment-1366</guid>
		<description>&lt;p&gt;&lt;a href="http://wilshipley.com/blog/2005/02/free-programming-tips-are-worth-every.html" rel="nofollow"&gt;Here is that link&lt;/a&gt;. Very sorry about, you can edit the previous one and delete this one if you care to do that much editing.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><a href="http://wilshipley.com/blog/2005/02/free-programming-tips-are-worth-every.html" rel="nofollow">Here is that link</a>. Very sorry about, you can edit the previous one and delete this one if you care to do that much editing.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Wesley Walser</title>
		<link>http://particletree.com/notebook/javascript-optimization/#comment-1365</link>
		<dc:creator>Wesley Walser</dc:creator>
		<pubDate>Tue, 13 Dec 2005 10:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=163#comment-1365</guid>
		<description>&lt;p&gt;I have always followed the method where I code something with simple readable functions. I try to make them bulletproof, I try to make them work right, and I comment the heck out of them. What I don't specifically try and think about is optimization.&lt;/p&gt;

&lt;p&gt;Optimization comes when you are done with an application, or in larger applications, a section of the application and you test it. While testing things, figure out what is running slowly, and fix those aspects of the program.&lt;/p&gt;

&lt;p&gt;Thinking of optimization during every second of programming will have your pulling all kinds of crap into your brain at all the wrong times. Sure it may be more optimized to have an array of characters instead of a string, but who does that. You will end up taking months to code what could be done in a week, and really you have saved milliseconds in most places. The key is after things are winding down in development to find the areas that you can save actual seconds.&lt;/p&gt;

&lt;p&gt;As far as easy to understand code goes, I think it's almost always better to got with more readability over speed. If there is an exception to this I think it will be painfully obvious when it pops us (read: when you need to get a new computer to run your code).&lt;/p&gt;

&lt;p&gt;&lt;a href="" rel="nofollow"&gt;Here is a great post that covers some of this.&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I have always followed the method where I code something with simple readable functions. I try to make them bulletproof, I try to make them work right, and I comment the heck out of them. What I don&#8217;t specifically try and think about is optimization.</p>

<p>Optimization comes when you are done with an application, or in larger applications, a section of the application and you test it. While testing things, figure out what is running slowly, and fix those aspects of the program.</p>

<p>Thinking of optimization during every second of programming will have your pulling all kinds of crap into your brain at all the wrong times. Sure it may be more optimized to have an array of characters instead of a string, but who does that. You will end up taking months to code what could be done in a week, and really you have saved milliseconds in most places. The key is after things are winding down in development to find the areas that you can save actual seconds.</p>

<p>As far as easy to understand code goes, I think it&#8217;s almost always better to got with more readability over speed. If there is an exception to this I think it will be painfully obvious when it pops us (read: when you need to get a new computer to run your code).</p>

<p><a href="" rel="nofollow">Here is a great post that covers some of this.</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Edwards</title>
		<link>http://particletree.com/notebook/javascript-optimization/#comment-1364</link>
		<dc:creator>Dean Edwards</dc:creator>
		<pubDate>Tue, 13 Dec 2005 05:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=163#comment-1364</guid>
		<description>&lt;p&gt;The point of this tip was to get people to think about how often checks are made when executing code. It is a general programming tip that seasoned programmers will probably not look twice at. However, code branching such as this is quite common in web applications. Functions that are called from within loops should be optimised as much as possible. I hope that I have made people think a little more about increasing the responsiveness of their UIs. Every little helps! ;-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The point of this tip was to get people to think about how often checks are made when executing code. It is a general programming tip that seasoned programmers will probably not look twice at. However, code branching such as this is quite common in web applications. Functions that are called from within loops should be optimised as much as possible. I hope that I have made people think a little more about increasing the responsiveness of their UIs. Every little helps! ;-)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Mescalchin</title>
		<link>http://particletree.com/notebook/javascript-optimization/#comment-1363</link>
		<dc:creator>Peter Mescalchin</dc:creator>
		<pubDate>Tue, 13 Dec 2005 04:05:11 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=163#comment-1363</guid>
		<description>&lt;p&gt;Interesting counter argument - true if you're talking mere microseconds then it's not a big deal - but I still think the general idea can be applied to repeat sections of code.&lt;/p&gt;

&lt;p&gt;I see it more as a general programming rule of thumb - regardless of language. For example I call a function foo(parameter) with the same parameter value in a chunk of code and each time and receive the same result I could do this :&lt;/p&gt;

&lt;p&gt;document.write foo(parameter);
document.write foo(parameter);
document.write foo(parameter);&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;or this -&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;myValue = foo(parameter);
document.write myValue;
document.write myValue;
document.write myValue;&lt;/p&gt;

&lt;p&gt;Sure they achieve the same result - but if to determine the return value of foo() takes a considerable timeslice - of course I would lean to method two. Simple optimisations are easy to make at coding time and do add up.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Interesting counter argument - true if you&#8217;re talking mere microseconds then it&#8217;s not a big deal - but I still think the general idea can be applied to repeat sections of code.</p>

<p>I see it more as a general programming rule of thumb - regardless of language. For example I call a function foo(parameter) with the same parameter value in a chunk of code and each time and receive the same result I could do this&#160;:</p>

<p>document.write foo(parameter);
document.write foo(parameter);
document.write foo(parameter);</p>

<ul>
<li>or this -</li>
</ul>

<p>myValue = foo(parameter);
document.write myValue;
document.write myValue;
document.write myValue;</p>

<p>Sure they achieve the same result - but if to determine the return value of foo() takes a considerable timeslice - of course I would lean to method two. Simple optimisations are easy to make at coding time and do add up.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Wubben</title>
		<link>http://particletree.com/notebook/javascript-optimization/#comment-1362</link>
		<dc:creator>Mark Wubben</dc:creator>
		<pubDate>Tue, 13 Dec 2005 03:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=163#comment-1362</guid>
		<description>&lt;p&gt;Yes, but does it actually help? Test case here: &lt;a href="http://novemberborn.net/javascript/optimizing/speed-up-object-detection" rel="nofollow"&gt;http://novemberborn.net/javascript/optimizing/speed-up-object-detection&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes, but does it actually help? Test case here: <a href="http://novemberborn.net/javascript/optimizing/speed-up-object-detection" rel="nofollow">http://novemberborn.net/javascript/optimizing/speed-up-object-detection</a></p>]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.297 seconds -->
