<?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; unresponsive script error</title> <atom:link href="http://werxltd.com/wp/tag/unresponsive-script-error/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>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_2">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> </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/10 queries in 0.003 seconds using apc
Object Caching 354/365 objects using apc

Served from: werxltd.com @ 2012-02-05 04:16:34 -->
