<?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; optimization</title> <atom:link href="http://werxltd.com/wp/tag/optimization/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>Magical PHP JSON Object Cleaner</title><link>http://werxltd.com/wp/2009/07/29/magical-php-json-object-cleaner/</link> <comments>http://werxltd.com/wp/2009/07/29/magical-php-json-object-cleaner/#comments</comments> <pubDate>Wed, 29 Jul 2009 14:27:03 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[software development]]></category> <category><![CDATA[json]]></category> <category><![CDATA[optimization]]></category> <category><![CDATA[php]]></category> <category><![CDATA[recursive]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=159</guid> <description><![CDATA[I wrote this method the other day that takes a simple PHP object, inspects it&#8217;s properties and &#8220;prunes&#8221; empty ones. I wrote this method in order to compress JSON objects by removing null properties before sending them down the wire, a big problem when using base objects or models. If you find this useful or [...]]]></description> <content:encoded><![CDATA[<p>I wrote this method the other day that takes a simple PHP object, inspects it&#8217;s properties and &#8220;prunes&#8221; empty ones. I wrote this method in order to compress JSON objects by removing null properties before sending them down the wire, a big problem when using base objects or models.</p><p>If you find this useful or a have a suggestion, feel free to let me know!</p><pre class="brush:php">
private function getStripped($obj) {
		$objVars = get_object_vars($obj);

		if(count($objVars) > 0) {
			foreach($objVars as $propName => $propVal) {
				if(gettype($propVal) == "object") {
					$cObj = $this->getStripped($propVal);
					if($cObj == null) {
						unset($obj->$propName);
					} else {
						$obj->$propName = $cObj;
					}
				} else {
					if(empty($propVal)) {
						unset($obj->$propName);
					}
				}
			}
		} else {
			return null;
		}
		return $obj;
	}</pre><div
class="betterrelated none"><p>No related content found.</p></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%2F2009%2F07%2F29%2Fmagical-php-json-object-cleaner%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%2F29%2Fmagical-php-json-object-cleaner%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%2F29%2Fmagical-php-json-object-cleaner%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F29%2Fmagical-php-json-object-cleaner%2F&amp;count=none&amp;text=Magical%20PHP%20JSON%20Object%20Cleaner" 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%2F29%2Fmagical-php-json-object-cleaner%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F29%2Fmagical-php-json-object-cleaner%2F&amp;count=none&amp;text=Magical%20PHP%20JSON%20Object%20Cleaner" 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%2F29%2Fmagical-php-json-object-cleaner%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%2F29%2Fmagical-php-json-object-cleaner%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%2F29%2Fmagical-php-json-object-cleaner%2F&amp;linkname=Magical%20PHP%20JSON%20Object%20Cleaner" 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%2F29%2Fmagical-php-json-object-cleaner%2F&amp;title=Magical%20PHP%20JSON%20Object%20Cleaner" id="wpa2a_4">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2009/07/29/magical-php-json-object-cleaner/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/16 queries in 0.311 seconds using apc
Object Caching 432/457 objects using apc

Served from: werxltd.com @ 2012-02-08 14:39:07 -->
