<?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>TimKadlec.com &#187; Performance</title>
	<atom:link href="http://timkadlec.com/category/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://timkadlec.com</link>
	<description>A Wisconsin based web developer writing about the web.</description>
	<lastBuildDate>Tue, 13 Jul 2010 01:30:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Performance Toolbelt: CSSEmbed</title>
		<link>http://timkadlec.com/2010/07/performance-toolbelt-css-embed/</link>
		<comments>http://timkadlec.com/2010/07/performance-toolbelt-css-embed/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 01:30:29 +0000</pubDate>
		<dc:creator>tkadlec</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timkadlec.com/?p=576</guid>
		<description><![CDATA[One of the biggest keys to improving the load time of your site is minimizing the number of HTTP requests. There&#8217;s a lot of overhead involved with each request, and many requests can very quickly slow down your site. One great way to eliminate extra requests is to use data URIs instead of images. If [...]]]></description>
			<content:encoded><![CDATA[<p>One of the biggest keys to improving the load time of your site is minimizing the number of HTTP requests. There&#8217;s a lot of overhead involved with each request, and many requests can very quickly slow down your site. One great way to eliminate extra requests is to use data URIs instead of images. If you want the nitty-gritty on what data URIs are, and how to use them, there are a few excellent posts by <a href="http://www.phpied.com/data-urls-what-are-they-and-how-to-use/">Stoyan Stefanov</a> and <a href="http://www.nczonline.net/blog/2009/10/27/data-uris-explained/">Nicholas Zakas</a> that walk you through the details.</p>
<p>Data URIs can be tricky to implement efficiently however. Since they are a Base64-encoded representation of an image, there is a built-in level of obfuscation that can make manual maintenance tedious. Thankfully, Nicholas put together a command line tool called CSSEmbed which takes the pain out of using them.</p>
<p>CSSEmbed is a very straightforward tool that parses a stylesheet and converts all references of images to their data URI equivalents. Installation is as simple as <a href="http://wiki.github.com/nzakas/cssembed/">downloading the .jar file</a> and placing it where you&#8217;d like. Then you use a simple command specifying any options, the file to output to, and the file to parse, like so:</p>
<p><code>java -jar cssembed.jar -o styles_uri.css styles.css</code></p>
<p>Since versions of Internet Explorer prior to IE8 don&#8217;t support data URIs, you have to use MHTML as a workaround (again, Stoyan has an <a href="http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/">excellent post</a> with more info). The command for that is very similar — you just need to make sure to declare a &#8220;root&#8221; (for example, I&#8217;d use http://timkadlec.com as my root for this site) which CSSEmbed will use in the MHTML.</p>
<p><code>java -jar cssembed.jar -o styles_mhtml.css styles.css --mhtml --mhtmlroot http://timkadlec.com</code></p>
<p>Right now, to my knowledge, you can&#8217;t parse an entire directory of CSS files, but that&#8217;s about the only thing I can think of that I&#8217;d like to see added. It&#8217;s a great tool to use during an automated build to really simplify the process of using data URIs and I definitely encourage you to go download it and give it a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://timkadlec.com/2010/07/performance-toolbelt-css-embed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Toolbelt: Page Speed</title>
		<link>http://timkadlec.com/2010/05/performance-toolbelt-page-speed/</link>
		<comments>http://timkadlec.com/2010/05/performance-toolbelt-page-speed/#comments</comments>
		<pubDate>Wed, 12 May 2010 02:53:03 +0000</pubDate>
		<dc:creator>tkadlec</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timkadlec.com/?p=395</guid>
		<description><![CDATA[Like it's older brother YSlow, Page Speed, released by Google in in mid-2009, is primarily a tool to audit and analyze the performance of your site. However a closer looks shows that there is in fact a lot more that Page Speed can do.]]></description>
			<content:encoded><![CDATA[<p>Like it&#8217;s older brother YSlow, <a title="Page Speed" href="http://code.google.com/speed/page-speed/">Page Speed</a>, released by Google in in mid-2009, is primarily a tool to audit and analyze the performance of your site. However a closer looks shows that there is in fact a lot more that Page Speed can do.</p>
<h2>What Does It Test</h2>
<p>Page Speed analyzes the performance of a page based on a set of 26 rules (as of version 1.7) that Google has documented. Each rule is given a priority code based on how great the potential impact would be on the page load time. Once Page Speed has determined which rules are broken, it gives the page a score between 0 and 100, which can be exported in JSON format, or sent straight to <a href="http://www.showslow.com/">ShowSlow.com</a> &#8211; a tool for recording YSlow and Page Speed scores over time.<span id="more-395"></span></p>
<p>The rules range from common rules like optimize your images, to lesser known techniques like defining a character set early. A complete list of the rules Page Speed checks for is below:</p>
<ol class="reg">
<li>Combine external CSS</li>
<li>Minimize DNS lookups</li>
<li>Leverage browser caching</li>
<li>Remove unused CSS</li>
<li>Leverage proxy caching</li>
<li>Minify CSS</li>
<li>Minify HTML</li>
<li>Minify Javascript</li>
<li>Specify image dimensions</li>
<li>Serve static content from a cookieless domain</li>
<li>Use efficient CSS selectors</li>
<li>Avoid bad requests</li>
<li>Combine external JavaScript</li>
<li>Enable compression</li>
<li>Minimize redirects</li>
<li>Minimize request size</li>
<li>Optimize images</li>
<li>Optimize the order of styles and scripts</li>
<li>Put CSS in the document head</li>
<li>Serve resources from a consistent URL</li>
<li>Serve scaled images</li>
<li>Specify a character set early</li>
<li>Avoid CSS expressions</li>
<li>Defer loading of JavaScript</li>
<li>Parallelize downloads across hostnames</li>
<li>Specify a cache validator</li>
</ol>
<h2>What Else Can It Do</h2>
<p>Like I said, while auditing may be the most well known feature of Page Speed, it is far from being the extent of its capabilities. In addition to performing a basic audit of your page, Page Speed automatically optimizes the Javascript files, CSS files, and images that it finds on the page, and saves them to a folder on your computer (which you can specify). It also has the ability to profile deferred Javascript files &#8211; something it does not do by default.</p>
<p>Perhaps the most fun though comes when you use the Page Speed Activity panel. At it&#8217;s most basic usage, the activity panel lets you record a timeline of all the browser activities, including both network activity and Javascript processing, that take place during the time you choose to record. That means that you get detail like how much time was spent connecting to the server, and how much time was spent executing the Javascript.</p>
<p>The activity panel also allows you to see a list of all the Javascript functions that were instantiated, but not called, during the recording period. This information could help you determine what portions of your code are not necessary immediately so that you can choose to load them later, allowing you to further improve your load time. You can also record &#8220;paint snapshots&#8221; in the activity panel which highlight each element in a page as it is rendered.</p>
<p>While the advanced features offered by the activity panel are very useful, it&#8217;s important to keep in mind that they do slow down the Page Speed plugin a little. Since they add a little bit more overhead, the timeline will not be 100% accurate and will serve you better as a relative reference than an exact approximation of the time it takes your page to load.</p>
<h2>It&#8217;s Open Source Too!</h2>
<p>Just recently, the <a href="http://code.google.com/p/page-speed/wiki/DownloadPageSpeed?tm=2">Page Speed SDK</a> was released as open source. Already, Steve Souders has demonstrated the usefulness of this by building <a href="http://www.stevesouders.com/blog/2010/05/01/har-to-page-speed/">HAR to Page Speed</a> &#8211; a tool that will apply the Page Speed rules to a HAR (HTTP Archive specification &#8211; a format gaining popularity) file you upload.</p>
<p>By opening the SDK up to open source, the potential is there for developers to build cross-platform tools that would allow people to analyze the performance of their site according to the Page Speed rules, regardless of the browser in use. It&#8217;s going to be exciting to see what other tools get built around the SDK as it continues to evolve.</p>
]]></content:encoded>
			<wfw:commentRss>http://timkadlec.com/2010/05/performance-toolbelt-page-speed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance and Beauty</title>
		<link>http://timkadlec.com/2010/04/performance-and-beauty/</link>
		<comments>http://timkadlec.com/2010/04/performance-and-beauty/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 01:57:23 +0000</pubDate>
		<dc:creator>tkadlec</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timkadlec.com/?p=345</guid>
		<description><![CDATA[Google recently announced that how quickly a site loads will officially factor into their search algorithm. This seems to have caused a little bit of panic amongst some people in the web community.]]></description>
			<content:encoded><![CDATA[<p>By now I&#8217;m sure that most of you have heard about the <a href="http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html">recent announcement</a> by Google that speed is officially a factor in their rankings. This seems to have caused a little bit of panic amongst some people in the web community.</p>
<p>One web guru who you may have heard of, Jeffrey Zeldman, posted an <a href="http://www.zeldman.com/2010/04/11/of-google-and-page-speed/">article</a> on Sunday wherein he describes the choice he feels designers are now faced with:</p>
<blockquote><p>So now we face a dilemma. As we continue to seduce viewers via large, multiple background images, image replacement, web fonts or sIFR, and so on, we may find our beautiful sites losing page rank.</p></blockquote>
<p>It&#8217;s a fair enough point to make  - sometimes a designer will need to make a decision between additional aesthetic effects and improved performance (but not that often). What followed in the comments was disturbing though &#8211; many people were actually viewing Google&#8217;s move as a negative thing and seemed to be very worried about it&#8217;s effects.  Some felt Google was simply abusing their power, others believed they&#8217;d have to sacrifice good design in order to receive a decent ranking. The situation, I think, needs a little diffusing.<span id="more-345"></span></p>
<h2>Deep Breaths People</h2>
<p>First, let&#8217;s remember that Google themselves have said that this addition to their algorithm affects less than 1% of their search queries. That means that while it is a factor, it is certainly not the most important one. It also means that while Google wants to display sites that perform well, their standards are probably not that high. If they were, there&#8217;d be a lot more sites being penalized in the rankings.</p>
<p>Secondly, this is a great move by Google and is fantastic news for users. Study after study has demonstrated that users really care about how well a site performs. It&#8217;s been shown that performance has an effect on bounce rate, purchase amounts, queries per user, credibility and more. If Google really cares about presenting their users with the best content, then this was a great demonstration of that belief.</p>
<h2>You Can Have Your Cake and Eat It Too</h2>
<p>Finally, there&#8217;s no need to panic &#8211; a site can be beautiful and still perform very well. For an example, let&#8217;s look at Happy Cog&#8217;s own <a title="visitphilly.com" href="http://www.visitphilly.com/">visitphilly.com</a>, both because it is a beautiful site, and because this conversation was started on Zeldman&#8217;s blog.</p>
<p>A quick look lets us identify some easy improvements. For one, there are 47 CSS background images. A quick run through <a title="SpriteMe" href="http://spriteme.org/">SpriteMe</a> trims that number down to 15.</p>
<p>There are also 7 scripts being called, 3 of which are unminified. At least a few of the seven could be concatenated to reduce some more requests and running the 3 unminified scripts through a compressor shaves a whopping 54% percent off their combined size. Finally, by running the images on the home page through <a title="Smush.It" href="http://smush.it/">Smush.It</a>, we eliminate another 133KB of baggage.</p>
<p>When you add those fixes together, the performance of the site would be dramatically improved, and the visual experience would not be diminished at all. It would be indistinguishable from the unoptimized version in every way, except that it would load significantly quicker.</p>
<p>So in summary, performance and beauty are not mutually exclusive. By taking performance into consideration, Google is not making the web a difficult place for designers; they&#8217;re simply making the web a more usable and less frustrating place for users.</p>
]]></content:encoded>
			<wfw:commentRss>http://timkadlec.com/2010/04/performance-and-beauty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Performance Toolbelt: SpriteMe</title>
		<link>http://timkadlec.com/2010/03/performance-toolbelt-spriteme/</link>
		<comments>http://timkadlec.com/2010/03/performance-toolbelt-spriteme/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 01:22:44 +0000</pubDate>
		<dc:creator>tkadlec</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timkadlec.com/?p=289</guid>
		<description><![CDATA[Having a lot of images in a page can be very costly. Each image requires an HTTP request, and each HTTP request comes with plenty of overhead. SpriteMe is a quick and easy way to generate sprites in an existing site.]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in a <a href="http://timkadlec.com/2010/02/performance-optimization-made-quick-and-simple/">prior post</a>, there are a lot of really good tools available to developers to aid in making performance optimization quick and easy. I&#8217;ve decided to highlight some of my favorite tools that I&#8217;ve come across and thought I&#8217;d kick things off with <a href="http://souders.org/">Steve Souders</a> excellent <a href="http://spriteme.org">SpriteMe</a> bookmarklet.</p>
<p>Having a lot of images in a page can be very costly. Each image requires an HTTP request, and each HTTP request comes with <a href="http://www.phpied.com/reducing-the-number-of-page-components/">plenty of overhead</a>. I&#8217;ve seen pages with 20+ icons, each requiring their own request &#8211; that&#8217;s a serious hinderance to performance.<span id="more-289"></span></p>
<p>A way of combatting the issue is to use sprites. For the uninitiated, an image sprite is simply one big image that includes many smaller images. This allows you to make one HTTP request, and using CSS, still make use of a variety of different images. If you plan ahead and do this while initially building the site, it&#8217;s rather simple to do. How do you quickly implement this strategy in an existing site though?</p>
<p>That&#8217;s where SpriteMe comes in. Steve Souders wrote a handy bookmarklet that looks through the images on a given page and identifies those that could potentially be combined into a sprite. At that point, it gives you a simple drag and drop interface with which you can add or remove items from a sprite. Once you&#8217;ve determined which images you&#8217;d like to combine, you can click &#8220;make sprite&#8221; and the bookmarklet will automatically create the image sprite for you, inject it into the page, and show you the CSS you&#8217;ll need to add.</p>
<p>From there it&#8217;s as simple as downloading the image and copying the CSS the tool provides into your stylesheet (I believe the ability to export the CSS is being worked on). On one recent project, I used SpriteMe to create a sprite from ~25 images that were being used in the site&#8217;s navigation in about 15 minutes of work. The only additional step I took was to run the generated sprite through OptiPng to shave some filesize off (I&#8217;ll talk about OptiPng in another post).</p>
<p>So what are the downsides? Not too much. I&#8217;d love to see it do some optimization on the sprites it produces &#8211; in the example I gave above, OptiPng shaved ~40% off the file size off. I&#8217;d also be willing to bet that the tool produces a bit more whitespace than is optimal or necessary in it&#8217;s sprites resulting in more <a href="http://blog.vlad1.com/2009/06/22/to-sprite-or-not-to-sprite/">memory usage</a>. To be fair, I haven&#8217;t tried to remove some of that excess whitespace to determine how big of a deal it really is.</p>
<p>All things considered, these are minor issues. I can easily run an image optimization tool on the produced sprite to fix that up, and it&#8217;s not like there&#8217;s THAT much whitespace &#8211; just probably a bit more than needed. These are, in my opinion, minor tradeoffs for the incredible convenience this tool provides.</p>
]]></content:encoded>
			<wfw:commentRss>http://timkadlec.com/2010/03/performance-toolbelt-spriteme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Optimization Made Quick and Simple</title>
		<link>http://timkadlec.com/2010/02/performance-optimization-made-quick-and-simple/</link>
		<comments>http://timkadlec.com/2010/02/performance-optimization-made-quick-and-simple/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 08:00:23 +0000</pubDate>
		<dc:creator>tkadlec</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timkadlec.com/?p=236</guid>
		<description><![CDATA[Optimizing your site's performance doesn't have to be very difficult. Make use of the tools available to you, and it's downright scary how quickly you can speed up a site.]]></description>
			<content:encoded><![CDATA[<p>Optimizing your site&#8217;s performance doesn&#8217;t have to be very difficult. Take this site for example. Typically, I take care of optimization as part of the build process. However, for the sake of demonstration, I thought this time around I&#8217;d take care of each step by itself, using freely available tools where applicable.</p>
<p>First off was setting expires tags and turning gzipping on. Since I&#8217;ve done this in too many .htaccess files to count, this was simply a copy/paste job with very little tweaking necessary.<span id="more-236"></span></p>
<p>Then, I decided to optimize the images (what few there are). I ran <a href="http://developer.yahoo.com/yslow/smushit/">Smush.It</a> from the <a href="http://developer.yahoo.com/yslow/">YSlow</a> tool in Firefox. That compressed the images which I then downloaded to my computer and then promptly pushed right back up to the server. It took me 5, maybe 10 minutes and it cut the image size by about 33% total.</p>
<p>The icons for the RSS, Twitter and LinkedIn links in the footer were separate images &#8211; each requiring its own HTTP request. By using the <a href="http://spriteme.org/">SpriteMe</a> bookmarklet, I was able to generate a new sprite and the necessary CSS in a few minutes and trim those 3 HTTP requests down into one. I also ran <a href="http://optipng.sourceforge.net/">OptiPng</a> from the terminal window on my Mac on the new sprited image to shave off about 40% of the size.</p>
<p>I then minimized the CSS and Javascript (what little I was using) using <a href="http://www.phpied.com/omg-initial-checkin/">OMG</a>, which shaved ~30% off the file size of each.</p>
<p>Without any of these optimizations, my YSlow grade was a C and my page size was about 150K. After the 1/2 hour investment (if that&#8230;I&#8217;m being generous here) my YSlow grade came in at an A with a page size around 80K. Not bad for such little work.</p>
<p>There&#8217;s much more I can, and will, do here (caching, data-uri&#8217;s, etc.) but the moral of the story is that not optimizing your sites because it takes too long is just no longer an argument you can use. Make use of the tools available to you, and it&#8217;s downright scary how quickly you can speed up a site.</p>
]]></content:encoded>
			<wfw:commentRss>http://timkadlec.com/2010/02/performance-optimization-made-quick-and-simple/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
