<?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>Werx Limited &#187; performance</title> <atom:link href="http://werxltd.com/wp/tag/performance/feed/" rel="self" type="application/rss+xml" /><link>http://werxltd.com/wp</link> <description>We make IT work.</description> <lastBuildDate>Mon, 23 Jan 2012 23:03:59 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Javascript performance</title><link>http://werxltd.com/wp/2010/11/04/javascript-performance/</link> <comments>http://werxltd.com/wp/2010/11/04/javascript-performance/#comments</comments> <pubDate>Thu, 04 Nov 2010 12:00:39 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[optimisation]]></category> <category><![CDATA[optimization]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[speed]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=832</guid> <description><![CDATA[His biggest point is &#8220;do not optimize prematurely&#8221;. This is a sentiment I&#8217;ve heard a few times. Fred Brooks emphasizes it in Mythical Man Month, and Eric Raymond harps on it a bit in Art of Unix Programming. Another point he makes is how using &#8220;weird language syntax&#8221; like double bitwise not is sometimes faster [...]]]></description> <content:encoded><![CDATA[<p><object
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param
name="src" value="http://blip.tv/play/AYG4omIC" /><param
name="allowfullscreen" value="true" /><embed
type="application/x-shockwave-flash" width="480" height="300" src="http://blip.tv/play/AYG4omIC" allowfullscreen="true"></embed></object></p><p>His biggest point is &#8220;do not optimize prematurely&#8221;. This is a sentiment I&#8217;ve heard a few times. Fred Brooks emphasizes it in <a
href="http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1288620729&amp;sr=1-1">Mythical Man Month</a>, and Eric Raymond harps on it a bit in <a
href="http://www.amazon.com/Art-UNIX-Programming-Eric-Raymond/dp/0131429019">Art of Unix Programming</a>.</p><p>Another point he makes is how using &#8220;weird language syntax&#8221; like <a
href="http://james.padolsey.com/javascript/double-bitwise-not/">double bitwise not</a> is sometimes faster than their functional equivalents like <a
href="http://www.w3schools.com/jsref/jsref_parseint.asp">parseInt</a>.</p><p>And one surprising revelation (for me anyway) is that <a
href="http://fatagnus.com/unrolling-your-loop-for-better-performance-in-javascript/">unrolled loops</a> can sometimes be faster.</p><p>Overall, a great presentation, well worth your time if you work with javascript a lot.</p><div
class="betterrelated"><p><strong>Related content:</strong></p><ol><li> <a
href="http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/" title="Permanent link to Fred Brooks on the promise of object oriented programming">Fred Brooks on the promise of object oriented programming</a></li><li> <a
href="http://werxltd.com/wp/2010/09/27/mcafee-secure-url-shortener-firefox-add-on/" title="Permanent link to McAfee Secure URL Shortener Firefox Add-on">McAfee Secure URL Shortener Firefox Add-on</a></li></ol><a
class="thanks" style="font-size: smaller; text-decoration: none;" title="Related content found by the Better Related Posts plugin" href="http://www.nkuttler.de/wordpress-plugin/wordpress-related-posts-plugin/">Better Related Posts Plugin</a></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;count=none&amp;text=Javascript%20performance" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;count=none&amp;text=Javascript%20performance" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;linkname=Javascript%20performance" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F11%2F04%2Fjavascript-performance%2F&amp;title=Javascript%20performance" id="wpa2a_2">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/11/04/javascript-performance/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Cleaning up unresponsive script errors</title><link>http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/</link> <comments>http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/#comments</comments> <pubDate>Fri, 03 Jul 2009 18:58:13 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[software development]]></category> <category><![CDATA[extjs]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[javascript optimization]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[unresponsive script error]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=85</guid> <description><![CDATA[I recently worked on improving performance in a labor scheduling application. The app was originally designed to load all the employees at one time in one large chunk, processing and stuffing the data into various places as needed on startup. This all worked fairly well on average stores with 50-100 employee records until we discovered [...]]]></description> <content:encoded><![CDATA[<p>I recently worked on improving performance in a labor scheduling application. The app was originally designed to load all the employees at one time in one large chunk, processing and stuffing the data into various places as needed on startup. This all worked fairly well on average stores with 50-100 employee records until we discovered several stores with 100+ employee records which caused the browser to display an <a
href="http://werxltd.com/wp/wp-content/uploads/2009/07/yahoo_unresponsive_script_1.jpg?9d7bd4">unresponsive script warning</a> due to the rather heavy pre-processing algorithms.</p><p>After scouring the web for clues to help me get rid of this warning without <a
href="http://lifehacker.com/162574/put-off-firefox-15s-unresponsive-script-dialogue">changing settings</a> on the browser, I found out that the only way to avoid these warnings was through a pseudo-threading pattern using setTimeout<sup><a
href="http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/#footnote_0_85" id="identifier_0_85" class="footnote-link footnote-identifier-link" title="http://www.dojotoolkit.org/forum/support/general-support/need-suggestions-how-manage-firefox-warning-unresponsive-script">1</a></sup><sup><a
href="http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/#footnote_1_85" id="identifier_1_85" class="footnote-link footnote-identifier-link" title="http://dev.opera.com/articles/view/efficient-javascript/?page=all">2</a></sup>.</p><p>One of the patterns I came up with to process a sequence of commands (such as adding records to a store) one at a time while still allowing the browser time to refresh and process other commands:</p><pre class="brush:javascript">var chainedTasks = [
   function() {
      console.log('first set of tasks');
   },
   function() {
      console.log('second set of tasks');
   },
   function() {
      console.log('third set of tasks');
   }
];

var currentTaskNum = 0;
var isExecuting = false;
var emptask = {var emptask = {
	scope: this,
	interval: 100,
	run: function(){
		if(currentTaskNum &gt; chainedTasks.length) {
			Ext.TaskMgr.stop(emptask);
		}

		if (!threadIsRunning) {
			threadIsRunning = true;
			if (typeof chainedTasks[currentTaskNum] === 'function') {
				chainedTasks[currentTaskNum](currentTaskNum);
			}
			currentTaskNum++;
			threadIsRunning = false;
		}
	}
};
Ext.TaskMgr.start(emptask);</pre><div
class="betterrelated none"><p>No related content found.</p></div><ol
class="footnotes"><li
id="footnote_0_85" class="footnote"><a
href="http://www.dojotoolkit.org/forum/support/general-support/need-suggestions-how-manage-firefox-warning-unresponsive-script">http://www.dojotoolkit.org/forum/support/general-support/need-suggestions-how-manage-firefox-warning-unresponsive-script</a></li><li
id="footnote_1_85" class="footnote"><a
href="http://dev.opera.com/articles/view/efficient-javascript/?page=all">http://dev.opera.com/articles/view/efficient-javascript/?page=all</a></li></ol><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;count=none&amp;text=Cleaning%20up%20unresponsive%20script%20errors" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;count=none&amp;text=Cleaning%20up%20unresponsive%20script%20errors" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;linkname=Cleaning%20up%20unresponsive%20script%20errors" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;title=Cleaning%20up%20unresponsive%20script%20errors" id="wpa2a_4">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Multi-threading in Web 2.0</title><link>http://werxltd.com/wp/2009/06/10/multi-threading-in-web-20/</link> <comments>http://werxltd.com/wp/2009/06/10/multi-threading-in-web-20/#comments</comments> <pubDate>Wed, 10 Jun 2009 19:21:22 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[software development]]></category> <category><![CDATA[extjs]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[multi threading]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[web 2.0]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=54</guid> <description><![CDATA[I've been tasked with speeding up a web 2.0 application based on ExtJS 2.2.0 that contains several routines that take up quite a bit of time and, because IE6's javascript processing engine is less than stellar ((In other words, it sucks pretty bad.)), I needed to find a way to "speed things up".]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been tasked with speeding up a web 2.0 application based on ExtJS 2.2.0 that contains several routines that take up quite a bit of time and, because <a
href="http://technologytales.com/2007/06/22/ie6-and-javascript-performance/">IE6&#8242;s javascript processing engine is less than stellar</a><sup><a
href="http://werxltd.com/wp/2009/06/10/multi-threading-in-web-20/#footnote_0_54" id="identifier_0_54" class="footnote-link footnote-identifier-link" title="In other words, it sucks pretty bad.">1</a></sup>, I needed to find a way to &#8220;speed things up&#8221;.</p><p>Enter <a
href="http://extjs.com/deploy/dev/docs/?class=Ext.TaskMgr">Ext.TaskMgr</a>, a helpful ExtJS object that is essentially a glorified <a
href="http://www.w3schools.com/htmldom/met_win_settimeout.asp">setTimeout</a> implementation that allows us to run tasks that don&#8217;t block execution. This means we can set our more expensive blocks of code to run later but return control back to the user in the meantime. It&#8217;s not true multi-threading, but it does allow us to make the user interface a lot more responsive and in an age when users think 5 seconds is an eternity, <a
href="http://msdn.microsoft.com/en-us/library/bb288452.aspx">perception is everything</a>.</p><div
class="betterrelated none"><p>No related content found.</p></div><ol
class="footnotes"><li
id="footnote_0_54" class="footnote">In other words, it sucks pretty bad.</li></ol>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2009/06/10/multi-threading-in-web-20/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 2/22 queries in 0.089 seconds using apc
Object Caching 504/542 objects using apc

Served from: werxltd.com @ 2012-02-05 03:31:19 -->
