<?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>American Butifarra &#187; Performance</title> <atom:link href="http://claude.betancourt.us/tag/performance/feed/" rel="self" type="application/rss+xml" /><link>http://claude.betancourt.us</link> <description>Claude Betancourt&#039;s Personal Blog</description> <lastBuildDate>Fri, 16 Dec 2011 02:43:25 +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>Compress JavaScript and CSS as Part of your Build Process</title><link>http://claude.betancourt.us/compress-javascript-and-css-as-part-of-your-build-process/</link> <comments>http://claude.betancourt.us/compress-javascript-and-css-as-part-of-your-build-process/#comments</comments> <pubDate>Mon, 05 Jul 2010 04:56:20 +0000</pubDate> <dc:creator>Claude</dc:creator> <category><![CDATA[How-To]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Compression]]></category> <category><![CDATA[Concatenation]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Performance]]></category> <category><![CDATA[Web Developement]]></category><guid isPermaLink="false">http://claude.betancourt.us/?p=736</guid> <description><![CDATA[Web page performance is critical to keeping customers and visitors moving along on your site. Slow responses typically result in frustrated users, unhappy customers and worse, abandoned orders. It is important to reduce the number of requests generated by a web page in order to increase its actual and perceived performance. <a href="http://claude.betancourt.us/compress-javascript-and-css-as-part-of-your-build-process/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Web page performance is critical to keeping customers and visitors moving along on your site. Slow responses typically result in frustrated users, unhappy customers and worse, abandoned orders. It is important to reduce the number of requests generated by a web page in order to increase its actual and perceived performance.</p><p>One critical way is to reduce the number of external files loaded by a page. Another one is to reduce their size through compression. This post aims to take this concept a step further by automating this tedious process using open-source libraries.</p><p><span id="more-736"></span></p><h3>Example</h3><p>This example will accomplish the task by executing the following steps:</p><ol><li>Create a temporary directory, <code>/build</code></li><li>Compress each JS file into <code>{original}-min.js</code> files</li><li>Compress each CSS file into <code>{original}-min.css</code> files</li><li>Concatenate all compressed JS files into <code>/js/complete.js</code></li><li>Concatenate all compressed CSS files into <code>/css/complete.css</code></li></ol><h3>Requirements</h3><ul><li>Make sure <a href="http://ant.apache.org/" alt="Apache Ant" title="Apache Ant">Apache Ant</a> has been installed on your system.</li><li>Check out a copy of the <a href="http://svn.betancourt.us/public/yui-compression-sample/">sample project</a> from my public SVN repository. This project already contains the open-source libraries necessary, <a href="http://yhoo.it/3FXTgK">YUI compressor</a> and <a href="http://bit.ly/avcPrG">YUI compressor Ant task</a>.</li><li>Setup a system variable, <code>COMPRESSOR_HOME</code> that points to the location of the sample project&#8217;s <code>/lib</code> directory.<ul><li>On Windows, right click My Computer and select properties. Then click the &#8220;Environment Variables&#8221; button under the advanced tab. Add a new system variable, <code>COMPRESSOR_HOME</code>, and set its value to your local path, for example: <code>C:\Documents and Settings\username\Desktop\yui-compression-sample\lib</code></li><li>On Mac OSX and Linux, update <code>~/.profile</code> or similar file and add <code>export COMPRESSOR_HOME=~/YourProjectDir/yui-compression-sample/lib</code></li></ul></li></ul><h3>Examine the configuration</h3><p>Take a look at the contents of <code>build.xml</code>. The first portion defines variables and locations of the libraries.</p><pre class="brush: xml; title: ; notranslate">
&lt;!-- tells Ant to refer to your environment vars --&gt;
&lt;property environment=&quot;env&quot; /&gt;

&lt;!-- defines location of libraries --&gt;
&lt;property name=&quot;lib.dir&quot; value=&quot;${env.COMPRESSOR_HOME}&quot; /&gt;

&lt;!-- defines output directory --&gt;
&lt;property name=&quot;build.dir&quot; value=&quot;build&quot; /&gt;

&lt;!-- output files, one for JS one for CSS --&gt;
&lt;property name=&quot;final_js&quot; value=&quot;${basedir}/js/complete.js&quot; /&gt;
&lt;property name=&quot;final_css&quot; value=&quot;${basedir}/css/complete.css&quot; /&gt;

&lt;!-- define nicknames for libraries --&gt;
&lt;property name=&quot;yui-compressor&quot; location=&quot;${lib.dir}/yuicompressor-2.4.2.jar&quot; /&gt;
&lt;property name=&quot;yui-compressor-ant-task&quot; location=&quot;${lib.dir}/yui-compressor-ant-task-0.5.jar&quot; /&gt;

&lt;!-- adds libraries to the classpath --&gt;
&lt;path id=&quot;yui.classpath&quot;&gt;
	&lt;pathelement location=&quot;${yui-compressor}&quot; /&gt;
	&lt;pathelement location=&quot;${yui-compressor-ant-task}&quot; /&gt;
&lt;/path&gt;

&lt;!-- define tasks --&gt;
&lt;taskdef name=&quot;yui-compressor&quot; classname=&quot;net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask&quot;&gt;
	&lt;classpath refid=&quot;yui.classpath&quot; /&gt;
&lt;/taskdef&gt;
</pre><p>The second portion of <code>build.xml</code> defines the Ant targets to be executed. These tell YUI compressor how the source files are to be processed.</p><pre class="brush: xml; title: ; notranslate">
&lt;!-- targets --&gt;
&lt;target name=&quot;concat&quot;&gt;

	&lt;!-- concatenates all compressed JS files into one --&gt;
	&lt;concat destfile=&quot;${final_js}&quot; force=&quot;true&quot; fixlastline=&quot;true&quot;&gt;
		&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;**/*.js&quot; /&gt;
		&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;**/widgets/*.js&quot; /&gt;
	&lt;/concat&gt;

	&lt;!-- concatenates all compressed CSS files into one --&gt;
	&lt;concat destfile=&quot;${final_css}&quot; force=&quot;true&quot; fixlastline=&quot;true&quot;&gt;
		&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;**/*.css&quot; /&gt;
		&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;**/flexgrid/*.css&quot; /&gt;
	&lt;/concat&gt;

&lt;/target&gt;

&lt;target name=&quot;compress&quot;&gt;

	&lt;!-- compresses each JavaScript and CSS file --&gt;
	&lt;!-- and saved as {original_name}-min.{extension} --&gt;
	&lt;yui-compressor
		warn=&quot;false&quot;
		munge=&quot;true&quot;
		preserveallsemicolons=&quot;false&quot;
		fromdir=&quot;${basedir}&quot;
		todir=&quot;${build.dir}&quot;
	/&gt;

&lt;/target&gt;

&lt;!-- deletes the temporary directory and all its contents --&gt;
&lt;target name=&quot;clean&quot;&gt;
	&lt;delete dir=&quot;${build.dir}&quot;/&gt;
&lt;/target&gt;

&lt;!-- creates the temporary directory --&gt;
&lt;target name=&quot;start&quot;&gt;
	&lt;mkdir dir=&quot;${build.dir}&quot; /&gt;
&lt;/target&gt;

&lt;target name=&quot;main&quot; depends=&quot;start,compress,concat,clean&quot; /&gt;
</pre><h3>What does this do?</h3><p>If you are new to Ant you are probably wondering why the tasks are defined in reverse order of execution. This is just a personal preference and it does not affect execution.</p><p>The order of execution is controlled by the <code>main</code> task. This is the task Ant runs when a target is not passed to it. The attribute <code>depends</code> tells Ant the order in which the tasks must be executed.</p><h3>Give it a try</h3><p>All you have to do to execute the entire operation is open a command prompt (or a terminal window on OS X), change into the project directory where <code>build.xml</code> lives and type <code>ant</code> and hit <code>Enter</code>. You should see some output that looks like this:</p><pre class="brush: plain; highlight: [19,20,32]; light: true; title: ; notranslate">
claude$ ant
Buildfile: build.xml

start:
     [echo] Building JS-CSS-Compression-and-Concat-Sample with Apache Ant version 1.7.1 compiled on April 8 2010 - System Java 1.6
    [mkdir] Created dir: /Users/claude/Documents/www/yui-compression-sample/build

compress:
[yui-compressor] [53%] global-print.css [920] ---&gt; global-print-min.css [488]
[yui-compressor] [80%] global.css [11895] ---&gt; global-min.css [9564]
[yui-compressor] [79%] style.css [1148] ---&gt; style-min.css [910]
[yui-compressor] [64%] googlemaps-yelp-ext.js [6604] ---&gt; googlemaps-yelp-ext-min.js [4270]
[yui-compressor] [70%] split-filepath.js [814] ---&gt; split-filepath-min.js [576]
[yui-compressor] [73%] ContactForm.js [4711] ---&gt; ContactForm-min.js [3461]
[yui-compressor] [57%] InfoTabs.js [1160] ---&gt; InfoTabs-min.js [669]
[yui-compressor] [55%] InfoWindow.js [1228] ---&gt; InfoWindow-min.js [686]
[yui-compressor] [68%] Intraday.js [9559] ---&gt; Intraday-min.js [6536]
[yui-compressor] [68%] MediaCenter.js [5728] ---&gt; MediaCenter-min.js [3906]
[yui-compressor] [JavaScript] Compressed 7 files to 67% (29KB to 19KB, saving 10KB)
[yui-compressor] [CSS] Compressed 3 files to 78% (13KB to 10KB, saving 3KB)
[yui-compressor] Compressed 10 files to 70% (42KB to 30KB, saving 12KB)

concat:
     [echo] Building /Users/claude/Documents/www/yui-compression-sample/js/complete.js
     [echo] Building /Users/claude/Documents/www/yui-compression-sample/css/complete.css

clean:
   [delete] Deleting directory /Users/claude/Documents/www/yui-compression-sample/build

main:

BUILD SUCCESSFUL
Total time: 1 second
</pre><h3>What Now?</h3><p>Change your HTML code to point to the newly created <code>complete.js</code> and <code>complete.css</code> instead of the individual files. Your page will load and render faster.</p><p>Squeeze even more performance out of your site by implementing other best practices. Get a copy of <a href="http://amzn.to/cueRAt">High Performance Web Sites</a> by Steve Souders and read <a href="http://yhoo.it/bjbsh4">Yahoo&#8217;s rules for exceptional performance</a>.</p><p class="note">Watch <a href="http://www.youtube.com/watch?v=BTHvs3V8DBA#t=90s">Steve Souders&#8217; presentation at Google Tech Talks</a>. Audio problems are fixed 5 minutes in. Skip the first 90 seconds to listen to Steve.</p> ]]></content:encoded> <wfw:commentRss>http://claude.betancourt.us/compress-javascript-and-css-as-part-of-your-build-process/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Persistent Storage for Web Apps</title><link>http://claude.betancourt.us/beyond-cookies-persistent-storage-for-web-apps/</link> <comments>http://claude.betancourt.us/beyond-cookies-persistent-storage-for-web-apps/#comments</comments> <pubDate>Wed, 29 Apr 2009 01:32:45 +0000</pubDate> <dc:creator>Claude</dc:creator> <category><![CDATA[Articles]]></category> <category><![CDATA[Presentation]]></category> <category><![CDATA[Video]]></category> <category><![CDATA[Dojo]]></category> <category><![CDATA[Gears]]></category> <category><![CDATA[HTML5]]></category> <category><![CDATA[Performance]]></category> <category><![CDATA[Storage]]></category><guid isPermaLink="false">http://claude.betancourt.us/?p=464</guid> <description><![CDATA[Brad Neuberg talks about the latest ways to achieve browser-based client-side storage and how it can help you make better web apps. <a href="http://claude.betancourt.us/beyond-cookies-persistent-storage-for-web-apps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><span class="drop_cap">W</span>eb developers now have the ability to store large amounts of persistent data on the client-side, way beyond the 4K limit of cookies. Options include HTML 5 Storage, Gears, Dojo Storage, and more. <a href="http://codinginparadise.org/">Brad Neuberg</a> talks about the latest ways to achieve browser-based client-side storage and how it can help you make better web apps.</p><div align="center"><embed src=http://d.yimg.com/cosmos.bcst.yahoo.com/up/fop/embedflv/swf/fop.swf?shareEnable=1&#038;id=13207154&#038;autoStart=0&#038;infoEnable=0&#038;shareEnable=0&#038;prepanelEnable=1&#038;carouselEnable=0&#038;postpanelEnable=1 width=400 height=300 type=application/x-shockwave-flash></embed></div><p>Seen at the <a href="http://developer.yahoo.net/blogs/theater/archives/2009/04/beyond_cookies_persistent_storage_for_web_app.html">Yahoo! Developer Network Blog</a>.</p> ]]></content:encoded> <wfw:commentRss>http://claude.betancourt.us/beyond-cookies-persistent-storage-for-web-apps/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Image Optimization, AlphaImageLoader</title><link>http://claude.betancourt.us/image-optimization-alphaimageloader/</link> <comments>http://claude.betancourt.us/image-optimization-alphaimageloader/#comments</comments> <pubDate>Mon, 08 Dec 2008 15:47:37 +0000</pubDate> <dc:creator>Claude</dc:creator> <category><![CDATA[Articles]]></category> <category><![CDATA[Image Optimization]]></category> <category><![CDATA[Performance]]></category> <category><![CDATA[Yahoo!]]></category><guid isPermaLink="false">http://claude.betancourt.us/?p=281</guid> <description><![CDATA[This article, part 5 of a series on image optimization, talks about the use of transparent PNGs with IE6 and why the AlphaImageLoader hack is bad and a very interesting solution This installment of the image optimization series is about &#8230; <a href="http://claude.betancourt.us/image-optimization-alphaimageloader/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><span class="drop_cap">T</span>his article, part 5 of a series on image optimization, talks about the use of transparent PNGs with IE6 and why the AlphaImageLoader hack is bad and a very interesting solution</p><blockquote><p>This installment of the image optimization series is about the IE-proprietary AlphaImageLoader CSS filter, which developers often use as a workaround to solve transparency issues with truecolor PNGs in IE. The problem with AlphaImageLoader is that it hurts page performance and, therefore, hurts user experience. I argue that AlphaImageLoader should be avoided when at all possible.</p></blockquote><p><a href="http://yuiblog.com/blog/2008/12/08/imageopt-5/"><strong>The rest is here</strong></a>.</p> ]]></content:encoded> <wfw:commentRss>http://claude.betancourt.us/image-optimization-alphaimageloader/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ext-JS to Provide Free CDN Hosting for its Framework</title><link>http://claude.betancourt.us/ext-js-to-provide-free-cdn-hosting-for-its-framework/</link> <comments>http://claude.betancourt.us/ext-js-to-provide-free-cdn-hosting-for-its-framework/#comments</comments> <pubDate>Wed, 19 Nov 2008 04:32:28 +0000</pubDate> <dc:creator>Claude</dc:creator> <category><![CDATA[Ext JS]]></category> <category><![CDATA[Framework]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Platform]]></category> <category><![CDATA[Performance]]></category><guid isPermaLink="false">http://claude.betancourt.us/?p=234</guid> <description><![CDATA[This is great news for the Ext-JS community. Here is why you should take advantage of a content delivery network. We are pleased to announce that Ext has partnered with CacheFly, a global content network, to provide free CDN hosting &#8230; <a href="http://claude.betancourt.us/ext-js-to-provide-free-cdn-hosting-for-its-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><span class="drop_cap">T</span>his is great news for the Ext-JS community. <a href="http://developer.yahoo.com/performance/rules.html#cdn"><strong>Here is why</strong></a> you should take advantage of a content delivery network.</p><blockquote><p>We are pleased to announce that Ext has partnered with CacheFly, a global content network, to provide free CDN hosting for the Ext JS framework. Cachefly’s globally distributed network and aggressive caching accelerate the delivery of web content like JavaScript and CSS, making for an even faster Ext experience.</p><p>The Ext CDN also provides the ability to create your own custom builds using Ext’s Build It! tool, and host them on the CDN. The custom builder implements features to intelligently cache your component selections, adapter, and Ext version to create a unique custom build. These custom builds are cached across sessions and used by anyone who makes the same selections as you have &#8211; allowing for caching of custom builds across applications to fully realize the benefits of the CDN.</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://claude.betancourt.us/ext-js-to-provide-free-cdn-hosting-for-its-framework/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Steve Souders Releases Hammerhead, Firebug Extension</title><link>http://claude.betancourt.us/steve-souders-releases-hammerhead-firebug-extension/</link> <comments>http://claude.betancourt.us/steve-souders-releases-hammerhead-firebug-extension/#comments</comments> <pubDate>Wed, 01 Oct 2008 06:29:01 +0000</pubDate> <dc:creator>Claude</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Presentation]]></category> <category><![CDATA[Firebug]]></category> <category><![CDATA[Performance]]></category> <category><![CDATA[Testing]]></category><guid isPermaLink="false">http://claude.betancourt.us/?p=139</guid> <description><![CDATA[Improving performance starts with metrics. How long does it take for the page to load? Seems like a simple question to answer, but gathering accurate measurements can be a challenge. Enter Hammerhead, Steve Sounder's latest Firebug extension. <a href="http://claude.betancourt.us/steve-souders-releases-hammerhead-firebug-extension/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><span class="drop_cap">I</span>mproving performance starts with metrics. How long does it take for the page to load? Seems like a simple question to answer, but gathering accurate measurements can be a challenge. In my experience, performance metrics exist at four stages along the development process.</p><p><a href="http://www.stevesouders.com/blog/2008/09/30/hammerhead-moving-performance-testing-upstream/"><strong>Enter Hammerhead</strong></a>.</p><ul><li>real user data – I love real user metrics. JavaScript frameworks like Jiffy measure page load times from real traffic. When your site is used by a large, diverse audience, data from real page views is ground-truth.</li><li>bucket testing – When you’re getting ready to push a new release, if you’re lucky you can do bucket testing to gather performance metrics. You release the new code to a subset of users while maintaining another set of users on the old code (the “control”). If you sample your user population correctly and gather enough data, comparing the before and after timing information gives you a preview of the latency impact of your next release.</li><li>synthetic or simulated testing – In some situations, it’s not possible to gather real user data. You might not have the infrastructure to do bucket testing and real user instrumentation. Your new build isn’t ready for release, but you still want to gauge where you are with regard to performance. Or perhaps you’re measuring your competitors’ performance. In these situations, the typical solution is to do scripted testing on some machine in your computer lab, or perhaps through a service like Keynote or Gomez.</li><li>dev box – The first place performance testing happens (or should happen) is on the developer’s box. As she finishes her code changes, the developer can see if she made things better or worse. What was the impact of that JavaScript rewrite? What happens if I add another stylesheet, or split my images across two domains?</li></ul> ]]></content:encoded> <wfw:commentRss>http://claude.betancourt.us/steve-souders-releases-hammerhead-firebug-extension/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Served from: claude.betancourt.us @ 2012-02-07 15:13:31 by W3 Total Cache -->
