<?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/"
xmlns:series="http://unfoldingneurons.com/"
><channel><title>Larry Ullman &#187; performance</title> <atom:link href="http://www.larryullman.com/tag/performance/feed/" rel="self" type="application/rss+xml" /><link>http://www.larryullman.com</link> <description>Translating Geek Into English</description> <lastBuildDate>Sun, 05 Feb 2012 17:48:42 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Improving Site Performance: &#8220;Smushing&#8221; Images</title><link>http://www.larryullman.com/2011/07/10/improving-site-performance-smushing-images/</link> <comments>http://www.larryullman.com/2011/07/10/improving-site-performance-smushing-images/#comments</comments> <pubDate>Sun, 10 Jul 2011 00:54:41 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[smush]]></category> <category><![CDATA[yslow]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2357</guid> <description><![CDATA[In trying to improve my site&#8217;s performance, starting with using the YSlow! Firefox extension, I came across the concept of &#8220;smushing&#8221; images. Smush.it is a Yahoo! service (which is why it&#8217;s tied to YSlow!) that optimizes images in such a way as to reduce their size without adversely affecting image quality. I believe I reduced [...]]]></description> <content:encoded><![CDATA[<p>In trying to improve my site&#8217;s performance, starting with using the <a
href="http://developer.yahoo.com/yslow/">YSlow!</a> Firefox extension, I came across the concept of &#8220;smushing&#8221; images. <a
href="http://www.smush.it">Smush.it</a> is a Yahoo! service (which is why it&#8217;s tied to YSlow!) that optimizes images in such a way as to reduce their size without adversely affecting image quality. I believe I reduced my total image size by about 10-15%, which isn&#8217;t huge, but when you&#8217;re talking about Web site optimization, every little bit helps. The only thing to be aware of is that sometimes GIFs will get turned into more efficient PNGs, meaning you&#8217;ll need to change your HTML accordingly.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/07/10/improving-site-performance-smushing-images/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>What is Larry Thinking? #41 =&gt; Doing What I Do, Part 2</title><link>http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/</link> <comments>http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#comments</comments> <pubDate>Thu, 09 Jun 2011 13:23:04 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Adobe AIR]]></category> <category><![CDATA[Flex]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[api]]></category> <category><![CDATA[book]]></category> <category><![CDATA[dragonfly]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[opera]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[training]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2606</guid> <description><![CDATA[In this edition… About This Newsletter What Are You Thinking? =&#62; The JavaScript Book On the Web =&#62; Improving Application Performance On the Web =&#62; Opera Dragonfly On the Blog =&#62; UTC and Time Zone Support in MySQL On the Blog =&#62; How I Cut My Bandwidth in Half Q&#38;A =&#62; Should I use PHP [...]]]></description> <content:encoded><![CDATA[<p>In this edition…</p><ul><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#you">What Are You Thinking? =&gt; The JavaScript Book</a></li><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#web1">On the Web =&gt; Improving Application Performance</a></li><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#web2">On the Web =&gt; Opera Dragonfly</a></li><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#blog1">On the Blog =&gt; UTC and Time Zone Support in MySQL</a></li><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#blog2">On the Blog =&gt; How I Cut My Bandwidth in Half</a></li><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#qa">Q&amp;A =&gt; Should I use PHP or JavaScript to Handle API Data?</a></li><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#thinking">What is Larry Thinking =&gt; Doing What I Do: Training</a></li><li><a
href="http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/#news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) and More!</a></li></ul><p><span
id="more-2606"></span></p><h2 id="about">About This Newsletter</h2><p>No overarching theme to this newsletter, just some things that have popped up over the past three weeks, plus a preview of my next few months with respect to the books I&#8217;ll be writing. This newsletter also continues my spontaneous series on pursuing careers in IT, specifically focusing on training and teaching.</p><p>As always, questions, comments, and all feedback are much appreciated. And thanks for your interest in what I have to say and do!</p><h2 id="you">What Are You Thinking? =&gt; The JavaScript Book</h2><p>If you&#8217;ve been reading this newsletter for a while, you&#8217;re probably familiar with, if not sick of hearing about, my intent to self-publish a book on JavaScript (I&#8217;ve posted a rough <a
href="http://www.larryullman.com/2011/03/17/my-forthcoming-javascript-book-table-of-contents/">Table of Contents</a> and <a
href="http://www.larryullman.com/2011/03/15/previewing-my-forthcoming-javascript-book/">description</a> online). Part of the reason for self-publishing this particular book is that most every publisher already has their own JavaScript book already. Another part of the reason was to have the most control over the final product, both in terms of the content and the destination formats. I may or may not make more money self-publishing, so that&#8217;s not really a mitigating factor (I&#8217;ll make more per copy sold, electronic or print, but wouldn&#8217;t likely sell as many copies as I would through a publisher).</p><p>I&#8217;ve already started writing the book and done some research with respect to self-publishing, all with the hope of releasing the book some time this summer. In a surprising turn of events, a publisher has come to me wanting to put out the book. The publisher is very much willing to work with me on the concerns I have about control and the quality of electronic formats. And the publisher is better equipped to get the book into more places, including various electronic and online resources, international destinations, and translations. I&#8217;m clearly being coy about some of the details, but my question to those of you that might be interested in a JavaScript book written by me is whether you have a strong preference between a self-published book and one that&#8217;s traditionally published. Does it make a difference to you? Once you set aside the issues of subject and writer (which would be the same in both cases here), what criteria do you have for whether you buy a book and for how much you like a book?</p><p>As a writer, I have an entirely different sense of these things, so I would greatly appreciate any feedback you may have on this particular issue. I know which way I&#8217;m leaning here, but want to make sure I&#8217;m not overlooking something important. Thanks!</p><h2 id="web1">On the Web =&gt; Improving Application Performance</h2><p>I&#8217;m a big fan of <a
href="http://www.adobe.com/go/air">Adobe AIR</a>, and not just because <a
href="http://www.larryullman.com/books/adobe-air-adobe-integrated-runtime-with-ajax-visual-quickpro-guide/">I&#8217;ve written a book on it</a>! I&#8217;ve been developing AIR applications, for in-house and client use, for a few years now, in both JavaScript/HTML and Flex. I&#8217;ve recently, and not so recently, come across these two good articles on Adobe AIR:</p><ul><li><a
href="http://www.adobe.com/devnet/air/articles/air_performance.html">Performance-tuning Adobe AIR applications</a></li><li><a
href="http://www.adobe.com/devnet/air/articles/10_tips_building_on_air.html">Ten tips for building better Adobe AIR applications</a></li></ul><p>From the titles, the articles are self-explanatory, but the emphasis is on <em>performance</em>. The interesting thing about the first article is that it discusses the <em>theory</em> of performance, which people don&#8217;t think about enough (e.g., what does it mean to perform well?). The article uses a specific example for which one could easily come up with three different senses of &#8220;performance&#8221; (the article uses Flex for the code).</p><p>The second article has lots of specific, excellent tips, many of which being applicable to any application you develop (although the example also uses Flex for the code, it&#8217;s mostly ActionScript that you&#8217;ll see).</p><p>Even if you&#8217;re not using Adobe AIR, I would think these articles would be worth reading, as the subject of application performance is one we could all always continue to learn more about.</p><h2 id="web2">On the Web =&gt; Opera Dragonfly</h2><p>Admittedly, <a
href="http://www.opera.com">Opera</a> is about the fourth browser on my list (after, in order, Safari, Chrome, and Firefox), but the release of <a
href="http://www.opera.com/dragonfly/">Opera Dragonfly</a> may just change that for me, at least when it comes to Web development. Historically I&#8217;ve always relied upon Firefox&#8217;s <a
href="http://getfirebug.com">Firebug</a> extension when I need a good development debugging tool, but the Firefox browser has become such a memory hog for me that I&#8217;ve stopped using it on a regular basis. Of course, it&#8217;s probably a memory hog exactly because I&#8217;ve installed so many extensions (Firebug and the Web Developer Extension and …)!</p><p>On a cursory glance, Dragonfly may have everything I need:</p><ul><li>DOM viewer</li><li>JavaScript debugger: allowing you to set breakpoints, inspect the values of variables, and set conditions to watch for</li><li>HTML and CSS editor</li><li>Resource inspector: what resources are loaded by the page</li><li>Network traffic tool: a must for debugging Ajax, including the ability to craft your own requests to see the response</li><li>And more</li></ul><p>Unlike Firebug and other extensions, Dragonfly is built into Opera. Also unlike any comparable tool, Dragonfly can be used for remote debugging, including content destined for mobile devices or televisions!</p><p>I don&#8217;t know that Dragonfly alone will make me switch to Opera as my primary browser, but I have a strong feeling it will be my primary development browser for some time.</p><h2 id="blog1">On the Blog =&gt; UTC and Time Zone Support in MySQL</h2><p>In the third edition of my &#8220;<a
href="http://www.larryullman.com/books/php-6-and-mysql-5-for-dynamic-web-sites-visual-quickpro-guide-3rd-edition/">PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide</a>&#8221; book, and now in the fourth, too, I discuss using <em>Coordinated Universal Time</em> (strangely enough, abbreviated UTC) for storing dates and times in a MySQL database. I ran into a hiccup installing support for time zones in MySQL on my Mac, so I recently wrote <a
href="http://www.larryullman.com/2011/05/27/utc-and-time-zone-support-in-mysql/">a short blog post</a> introducing the subject and detailing the installation particulars on both Windows and Mac OS X.</p><h2 id="blog2">On the Blog =&gt; How I Cut My Bandwidth in Half</h2><p>Every so often I take a look at the Web stats for my site, as I expect we all do from time to time. It can be addicting stuff. Looking over the numbers in May, I realized that I managed to cut my bandwidth in half (since January), without ever intending to. In <a
href="http://www.larryullman.com/2011/05/16/how-i-cut-my-bandwidth-in-half/">this blog post</a>, I write about the steps I took that achieved this result, even though that wasn&#8217;t a goal.</p><h2 id="qa">Q&amp;A =&gt; Should I use PHP or JavaScript to Handle API Data?</h2><p>Daniel, who asks many good questions for use in these newsletters (thanks!), posed this:</p><blockquote><p>Can I use PHP or JavaScript to look through an array or parse data from a Web Service API in XML or JSON?</p></blockquote><p>The answer, in my opinion, depends upon what you intend to do with the data. If the data is needed temporarily, for example, to show something in the Web browser, you can use JavaScript. The benefit to JavaScript is that it will be the client (i.e., the Web browser) making the request, not the server, which can improve performance and reduce the server load. The downside is that JavaScript must be enabled in the browser and there are restrictions/tricks to performing cross-domain requests using JavaScript.</p><p>If the data will be needed for a longer period, if the same data might be presented to multiple users, or if you must do complex manipulation of the data, I would recommend using PHP. You&#8217;ll most likely want to use the <a
href="http://www.php.net/curl">cURL</a> library in PHP to do this, meaning your PHP version must support cURL and you&#8217;ll need to learn how to use it (although cURL isn&#8217;t that complicated and the PHP manual has good examples).</p><p>As with any time using an API (Application Programming Interface), I would strongly recommend you take the time to read the API&#8217;s usage terms to ensure compliance. For example, it may not be legal for your site to store data retrieved through an API, which would be another factor to consider.</p><h2 id="thinking">What is Larry Thinking? =&gt; Doing What I Do: Training</h2><p>In this newsletter I&#8217;m continuing what became a series on IT careers. I first wrote about becoming a better programmer, in two parts(<a
href="http://www.larryullman.com/2011/02/01/what-is-larry-thinking-36-becoming-a-better-programmer-and-more/#thinking">1</a> and <a
href="http://www.larryullman.com/2011/02/25/what-is-larry-thinking-37-becoming-a-better-programmer-part-2/#thinking">2</a>). Then I wrote about <a
href="http://www.larryullman.com/2011/03/22/what-is-larry-thinking-38-building-a-career/#thinking">building a career</a> and <a
href="http://www.larryullman.com/2011/04/16/what-is-larry-thinking-39-how-i-got-here-and-the-future/#thinking">how I got here</a>. In the previous newsletter, I wrote about <a
href="http://www.larryullman.com/2011/05/12/what-is-larry-thinking-40-doing-what-i-do-part-1/#thinking">some of the specifics of what I do</a>, focussing on the writing side. In this post, I&#8217;ll discuss another facet of my daily job: training. Unlike in the last newsletter, I&#8217;ll be more general about money here, as there&#8217;s just too much variation.</p><p>In the previous article, I said that about 60-70% of my income comes from writing, with the other 30-40% from training/teaching and Web/application development. In terms of <em>training</em> and <em>teaching</em>, early on I taught an online course on PHP through the <a
href="http://learn.berkeley.edu/">University of California at Berkeley</a>. Much like writing, it&#8217;s the type of work that sounds more impressive than it pays! I eventually stopped doing it, as it was a lot of work for not that much money, with quite a bit of responsibility and hassle. If you&#8217;ve done any teaching at all, you know of what I speak. But should you want to pursue this route, the best way to get such jobs is to already be associated with a school in some capacity (i.e., have an &#8220;in&#8221;). There is an argument to be made with this avenue that you&#8217;ll have somewhat regular income, albeit small, and it&#8217;s the kind of thing that you can perhaps use as a selling point for getting other work.</p><p>Off and on for the past several years, I&#8217;ve done more <em>training</em> jobs, by which I mean corporate on-site training over one or more days. Training jobs can pay very well, but are hard to get. If you&#8217;re interested in going that route, you should probably hook up with an organization that manages training. For example, <a
href="http://www.mysql.com/training/">MySQL arranges training courses</a>, so you could work with them (I don&#8217;t know how the arrangement has changed with Oracle&#8217;s purchase of MySQL, though). There are also companies that do all sorts of training, helping to market the courses, provide the facilities, and so forth. To work with one of these organizations (I&#8217;ve had discussions with them myself), it&#8217;s just a matter of proposing a class that appeals to them and extends their catalog. Much like trying to get a book or article published, it&#8217;s a matter of bringing a good idea to the right people. If you can get involved with training, and don&#8217;t mind traveling, you can make a very good living doing this. I personally consider it to be stressful, but I am deathly afraid of public speaking and put a lot of pressure on myself to have all the right answers going into such sessions. I still do training occasionally, though, as it gets me out of the house and pays some bills.</p><p>(As an aside, speaking at conferences is another kind of thing that sounds great but pays very poorly. In fact, at the entry level, speaking at conferences just earns you free admission to the conference. At the higher levels, perhaps your travel will be covered. But conferences are great networking opportunities and being a public speaker can, again, be a way to find other work, establish qualification to do certain work, and perhaps even allow you to charge more for other work.)</p><p>Whether you&#8217;re doing training or teaching (or speaking at conferences), do be mindful of who owns the copyright for the material you put together and whether the sessions can be recorded (and, if so, who owns those recordings). In these situations, a lot of your time and effort goes into the creation of the material, which isn&#8217;t how you will really make money. The true pay comes from actually teaching the course or providing the training. Make sure you&#8217;ll get your due for the work you put in.</p><p>I haven&#8217;t yet pursued this direction at all, but clearly the big push these days (or these past couple of years) is towards online video training. There are many companies, such as <a
href="http://www.lynda.com">Lynda</a>, that provide this service. To get these jobs, I expect, it&#8217;s a matter of convincing the right company that you&#8217;re the right person to create a training series on the right subject (like getting any other training job). I believe the economic model for these is a set sum to produce the video materials and then you&#8217;ll receive payments based upon usage (i.e., upon people watching them). Like with writing, you can help your cause in this area by producing your own low budget video training sessions to demonstrate your abilities. Post the videos you do on your own Web site and on YouTube, pay attention to the feedback you get, and build a career!</p><h2 id="news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP and MySQL for Dynamic Web Sites&#8221; (4th Edition) and More!</h2><p>May was a rough month for me, work-wise, which is to say I didn&#8217;t get nearly as much done as I would have liked. Now, I knew going into the month that that was going to be the case, but still… Anyway, I&#8217;m hoping June will be better. I am a couple of chapters away from completing the first draft of the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221;, which puts it to be released at the end of the summer. I think the book is turning out well, with nice updates and added content.</p><p>I&#8217;m probably going to use July as a catch-up month, although I have a number of side projects to work on, just nothing with a deadline. Either in July, or immediately thereafter, all of my attention will go to the JavaScript book (déjà vu: I think I&#8217;ve said this a time or two before, but this time I really, really mean it). With as much as I&#8217;ve spoken about this alleged and wily JavaScript book, and as many readers have said they&#8217;re looking forward to it, I&#8217;m starting to get that dread of living up to expectations. But I&#8217;ve got a lot to say about JavaScript, I&#8217;ve been thinking about this book for years, and there&#8217;s so much that can be done with today&#8217;s JavaScript, that I feel optimistic.</p><p>In the Fall, I&#8217;m still hoping to self-publish a book on the <a
href="http://www.yiiframework.com">Yii framework</a>, although I may just do an e-publication of that. In 2012, I&#8217;m planning on (and the publisher has agreed to) doing the third edition of my &#8220;<a
href="http://www.larryullman.com/books/php-5-advanced-visual-quickpro-guide-2nd-edition/">PHP 5 Advanced: Visual QuickPro Guide</a>&#8220;.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/06/09/what-is-larry-thinking-41-doing-what-i-do-part-2/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>An Absolute Beginner&#8217;s Introduction to Database Indexes</title><link>http://www.larryullman.com/2011/03/01/an-absolute-beginners-introduction-to-database-indexes/</link> <comments>http://www.larryullman.com/2011/03/01/an-absolute-beginners-introduction-to-database-indexes/#comments</comments> <pubDate>Tue, 01 Mar 2011 18:21:06 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[index]]></category> <category><![CDATA[performance]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2365</guid> <description><![CDATA[Properly creating indexes on database tables is a key ability and one that many developers have little confidence in (i.e., it&#8217;s a common question I see). I&#8217;ve written about the subject in my books, on my blog, and in my newsletter, but I recently StumbledUpon a good, quick article on the subject over at Kyle&#8217;s [...]]]></description> <content:encoded><![CDATA[<p>Properly creating indexes on database tables is a key ability and one that many developers have little confidence in (i.e., it&#8217;s a common question I see). I&#8217;ve written about the subject in my books, on my blog, and in my newsletter, but I recently <a
href="http://www.stumbleupon.com">StumbledUpon</a> a good, quick article on the subject over at <a
href="http://www.kylescousin.com/2010/09/an-absolute-beginners-introduction-to-database-indexes/">Kyle&#8217;s Cousin</a> that I thought I&#8217;d share. The article only dips its toe into the subject, but what it does well is two things. First, it demonstrates how you can confirm the effectiveness of indexes. And second, it explains what&#8217;s going on behind-the-scenes to better understand when and why indexes will be effective.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/03/01/an-absolute-beginners-introduction-to-database-indexes/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Top 20+ MySQL Best Practices &#124; Nettuts+</title><link>http://www.larryullman.com/2010/09/30/top-20-mysql-best-practices-nettuts-2/</link> <comments>http://www.larryullman.com/2010/09/30/top-20-mysql-best-practices-nettuts-2/#comments</comments> <pubDate>Thu, 30 Sep 2010 11:50:48 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[performance]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=1322</guid> <description><![CDATA[Some time ago I came across this post at Nettuts+ on the Top 20+ MySQL Best Practices. The ideas are simple, effective, and clearly explained. Well worth checking out if you use MySQL on a regular basis.]]></description> <content:encoded><![CDATA[<p>Some time ago I came across this post at Nettuts+ on the <a
href="http://net.tutsplus.com/tutorials/other/top-20-mysql-best-practices/">Top 20+ MySQL Best Practices</a>. The ideas are simple, effective, and clearly explained. Well worth checking out if you use MySQL on a regular basis.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2010/09/30/top-20-mysql-best-practices-nettuts-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>MySQL :: Using the New MySQL Query Profiler</title><link>http://www.larryullman.com/2010/08/24/mysql-using-the-new-mysql-query-profiler/</link> <comments>http://www.larryullman.com/2010/08/24/mysql-using-the-new-mysql-query-profiler/#comments</comments> <pubDate>Tue, 24 Aug 2010 09:30:31 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[benchmark]]></category> <category><![CDATA[performance]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=1244</guid> <description><![CDATA[I&#8217;m in the process of writing my latest book, &#8220;Effortless E-commerce with PHP and MySQL&#8221;, and as part of the process of writing any book, there&#8217;s lots of research involved. I want to check that I&#8217;m saying the right technical things (of course), but I also want to make sure that I&#8217;m doing things in [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m in the process of writing my latest book, &#8220;Effortless E-commerce with PHP and MySQL&#8221;, and as part of the process of writing any book, there&#8217;s lots of research involved. I want to check that I&#8217;m saying the right technical things (of course), but I also want to make sure that I&#8217;m doing things in an optimal way, that I&#8217;m using all the features and resources available to me, that I&#8217;ve reflected any recent changes in technology, etc. During this process, I just came across this article on MySQL&#8217;s SQL Profiler: <a
href="http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html" class="broken_link">Using the New MySQL Query Profiler</a>. I was looking for the best way to time the execution of various queries (specifically to compare straight SQL with stored procedures) when I saw this, and I was glad I did.</p><p>I&#8217;ll leave it up to you to read the full article, but the gist of it is that if you&#8217;re using MySQL 5.0.37 or greater and using the command-line mysql interface, you can enable profiling to see exact performance numbers for the queries you run. You can even see the nitty-gritty details: everything MySQL does to run the query, how long each step takes, and even what CPU or memory usage was required.</p><p>Between the SQL Profiler and the EXPLAIN the command, you can quickly improve how efficiently your SQL commands execute, which will improve the performance of your Web application as a whole. And, in a surprising result, I found that the stored procedures I created ran much, much faster than straight SQL (this was on MySQL 5.1.37). Clearly MySQL has been taking great strides to improve the performance of stored procedures, which used to be notoriously inefficient.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2010/08/24/mysql-using-the-new-mysql-query-profiler/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to Make Your Web Site Load Quickly</title><link>http://www.larryullman.com/2010/04/27/how-to-make-your-web-site-load-quickly/</link> <comments>http://www.larryullman.com/2010/04/27/how-to-make-your-web-site-load-quickly/#comments</comments> <pubDate>Tue, 27 Apr 2010 08:20:42 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[speed]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=1025</guid> <description><![CDATA[I StumbledUpon this tutorial on improving the load speed of your Web site. One interesting thing about this discussion is it starts with the DNS and how that factors into the speed: something I hadn&#8217;t considered. The tutorial also points out that download speeds have increased so much that it may be better to download [...]]]></description> <content:encoded><![CDATA[<p>I <a
href="http://www.stumbleupon.com">StumbledUpon</a> <a
href="http://www.wight-hat.com/guides/website-speed.html">this tutorial</a> on improving the load speed of your Web site. One interesting thing about this discussion is it starts with the DNS and how that factors into the speed: something I hadn&#8217;t considered. The tutorial also points out that download speeds have increased so much that it may be better to download fewer, larger resources (like all the CSS or JavaScript in one file) than more, smaller resources. Again, this is something I hadn&#8217;t thought about—I was still going with the old thinking of taking extra steps so that the user doesn&#8217;t have to download one iota of code more than they have to. The tutorial then goes into caching and compression, something I discuss in <a
href="http://www.larryullman.com/2009/01/19/speeding-up-web-sites-using-yahoo-yslow-part-2/">my series about applying YSlow!</a> to a site.</p><p>The tutorial goes on to talk about organizing HTML files: CSS at the top and JavaScript at the bottom. I&#8217;ve heard this before (about putting JavaScript right before the closing tag) but haven&#8217;t gotten around to testing it myself. It makes sense, though, as the browser doesn&#8217;t need the JavaScript to render the output for the user to see, and because the JavaScript code itself probably can&#8217;t do its thing until the HTML has loaded. If you keep reading, you&#8217;ll learn how to use CSS image sprites to minimize the number of images that have to be downloaded by the browser. My Web site has practically no images, so I haven&#8217;t used this myself, but it&#8217;s something that can dramatically improve the performance of a site.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2010/04/27/how-to-make-your-web-site-load-quickly/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Improving MySQL Performance</title><link>http://www.larryullman.com/2009/11/24/improving-mysql-performance/</link> <comments>http://www.larryullman.com/2009/11/24/improving-mysql-performance/#comments</comments> <pubDate>Tue, 24 Nov 2009 01:31:14 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[performance]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=521</guid> <description><![CDATA[The performance of any Web application is greatly impacted by how well the database application is being used (if being used, of course). The four biggest impacts on performance are: The storage engine(s) used How columns are defined The existence of proper indexes How queries are written and executed MySQL supports many different storage engines, [...]]]></description> <content:encoded><![CDATA[<p>The performance of any Web application is greatly impacted by how well the database application is being used (if being used, of course). The four biggest impacts on performance are:</p><ul><li>The <a
href="http://dev.mysql.com/doc/refman/5.1/en/storage-engines.html">storage engine(s)</a> used</li><li>How columns are defined</li><li>The existence of proper indexes</li><li>How queries are written and executed</li></ul><p>MySQL supports many different storage engines, each with its own strengths and weaknesses. Which you choose isn&#8217;t just a performance issue, it&#8217;s also one of features, like whether you need to support FULLTEXT searches (and therefore <a
href="http://dev.mysql.com/doc/refman/5.1/en/myisam-storage-engine.html">MyISAM tables</a>) or transactions (which means <a
href="http://dev.mysql.com/doc/refman/5.1/en/innodb.html">InnoDB</a>). Sometimes you can get away with using <a
href="http://dev.mysql.com/doc/refman/5.1/en/memory-storage-engine.html">HEAP</a> tables, which exist only in memory. There&#8217;s no permanent storage with HEAP tables, but the performance can&#8217;t be beat.</p><p>For the column definitions, the first goal is to use the smallest possible size for each column. This will be a limitation in your application, so the column&#8217;s size still needs to meet or exceed the largest possible value to be stored, but, generally speaking, the more data you want to possibly store, the more space will be required for all the data stored. You should also avoid allowing NULL values in columns. This is a factor in both good database design and in performance optimization.</p><p>The indexes you establish, and how they are used by queries, is a serious subject that requires a book in itself. To start, make sure you read MySQL&#8217;s own guide to <a
href="http://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html">how MySQL uses indexes</a>. Second, learn to run your queries using <a
href="http://dev.mysql.com/doc/refman/5.0/en/explain.html">EXPLAIN</a> to see what, exactly, MySQL is doing when it executes that query. Also, of course, only select the data your application will actually need. No need to retrieve information that won&#8217;t be used. And always go back and double-check that your queries need all the clauses and references they&#8217;ve got. I&#8217;ve been known to leave legacy conditionals in queries that have no effect whatsoever.</p><p>For more on some of these topics, see the MySQL manual, of course (which has <a
href="http://dev.mysql.com/doc/refman/5.1/en/optimization.html">a section on optimization</a>), the <a
href="http://planet.mysql.com/">PlanetMySQL</a> blog, and <a
href="http://www.databasejournal.com/features/mysql/article.php/3813821/Five-Query-Optimizations-in-MySQL.htm">this article at DatabaseJournal.com</a>. Also, if it applies to you, you can tweak MySQL&#8217;s behavior from a hardware/OS perspective. For an introduction to this subject, with respect to Linux, check out <a
href="http://www.linux-mag.com/cache/7473/1.html">this article</a> by <a
href="http://jeremy.zawodny.com/blog/">Jeremy Zawodny</a>, an expert on MySQL performance tuning.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/11/24/improving-mysql-performance/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Improving (Adobe AIR) Application Performance</title><link>http://www.larryullman.com/2009/05/24/improving-adobe-air-application-performance/</link> <comments>http://www.larryullman.com/2009/05/24/improving-adobe-air-application-performance/#comments</comments> <pubDate>Sun, 24 May 2009 14:51:11 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Adobe AIR]]></category> <category><![CDATA[Flex]]></category> <category><![CDATA[actionscript]]></category> <category><![CDATA[flash builder]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[tips]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=426</guid> <description><![CDATA[I&#8217;m a big fan of Adobe&#8217;s AIR, and not just because I&#8217;ve written a book on it! I&#8217;ve been developing AIR applications, for in-house and client use, for a couple of years now, in both JavaScript/HTML and Flex. I&#8217;ve recently, and not so recently, come across these two good articles on Adobe AIR: Performance-tuning Adobe [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m a big fan of <a
href="http://www.adobe.com/go/air">Adobe&#8217;s AIR</a>, and not just because <a
href="http://www.larryullman.com/books/adobe-air-adobe-integrated-runtime-with-ajax-visual-quickpro-guide/">I&#8217;ve written a book on it</a>! I&#8217;ve been developing AIR applications, for in-house and client use, for a couple of years now, in both JavaScript/HTML and Flex. I&#8217;ve recently, and not so recently, come across these two good articles on Adobe AIR:</p><ul><li><a
href="http://www.adobe.com/devnet/air/articles/air_performance.html">Performance-tuning Adobe AIR applications</a></li><li><a
href="http://www.adobe.com/devnet/air/articles/10_tips_building_on_air.html">Ten tips for building better Adobe AIR applications</a></li></ul><p>From the titles, the articles are self-explanatory, but the emphasis is on performance. The interesting thing about the first article is that it discusses the <em>theory</em> of performance, which people don&#8217;t think about enough (e.g., what does it mean to perform well?). The article uses a specific example for which one could easily come up with three different senses of &#8220;performance&#8221; (the article uses Flex for the code).</p><p>The second article has lots of specific, excellent tips, many of which being applicable to any application you develop (although the example also uses Flex for the code, it&#8217;s mostly ActionScript).</p><p>Even if you&#8217;re not using Adobe AIR, I would think these articles would be worth reading, as the subject of application performance is one we could all always continue to learn more about.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/05/24/improving-adobe-air-application-performance/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>JetProfiler for MySQL</title><link>http://www.larryullman.com/2009/03/22/jetprofiler-for-mysql/</link> <comments>http://www.larryullman.com/2009/03/22/jetprofiler-for-mysql/#comments</comments> <pubDate>Sun, 22 Mar 2009 13:47:33 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[database]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[software]]></category> <category><![CDATA[utilities]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=354</guid> <description><![CDATA[I&#8217;ve just recently come across a piece of software called Jet Profiler for MySQL. This is a program that runs on Mac OS X, Linux, and Windows (it&#8217;s runs on Java), and comes in both a free and commercial version. Jet Profiler for MySQL is a diagnostic tool, used to analyze and report upon your [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve just recently come across a piece of software called <a
href="http://www.jetprofiler.com/">Jet Profiler for MySQL</a>. This is a program that runs on Mac OS X, Linux, and Windows (it&#8217;s runs on Java), and comes in both a free and commercial version. Jet Profiler for MySQL is a diagnostic tool, used to analyze and report upon your database&#8217;s performance, specifically in terms of the queries run, the tables used, and the MySQL users. It also has more advanced capabilities, like reporting upon master/slave relationships, locking, threads, and so forth. One particularly interesting feature is that it doesn&#8217;t require any special server configuration; in fact, it doesn&#8217;t even need to be installed on the server. You can install the application on your desktop computer, create a new MySQL user on the server, and the software will connect through it. Software like this is another good way to better understand your database and your Web application.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/03/22/jetprofiler-for-mysql/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using Yahoo!’s YSlow: ETags and Compression</title><link>http://www.larryullman.com/2009/01/22/speeding-up-web-sites-using-yahoo-yslow-part-3/</link> <comments>http://www.larryullman.com/2009/01/22/speeding-up-web-sites-using-yahoo-yslow-part-3/#comments</comments> <pubDate>Thu, 22 Jan 2009 06:25:10 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[utilities]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=187</guid> <description><![CDATA[In two previous posts, I discussed analyzing my site using Yahoo!&#8217;s YSlow Firefox plug-in. I went through the initial test results and the steps I took to improve my score. At the end of part 2, I was left with a grade of 95 (whohoo!) but still two hurdles: ETags and sending compressed JavaScript and [...]]]></description> <content:encoded><![CDATA[<p>In two previous posts, I discussed analyzing my site using <a
href="http://developer.yahoo.com/yslow/">Yahoo!&#8217;s YSlow Firefox</a> plug-in. I went through the initial test results and the steps I took to improve my score. At the end of part 2, I was left with a grade of 95 (whohoo!) but still two hurdles: ETags and sending compressed JavaScript and CSS.<span
id="more-187"></span></p><p>New to me, and a slightly negative reflection on my site, was entity tags (<a
href="http://en.wikipedia.org/wiki/HTTP_ETag">ETags</a>). An ETag is a unique identifier for a resource. A browser (and other software) can check a resource&#8217;s ETag to know whether or not to download the resource, somewhat similar to how expiration headers are used. An ETag can be any value that represents the resource and changes when the resource changes. Commonly the server might use the <a
href="http://httpd.apache.org/docs/2.2/mod/core.html#fileetag">file&#8217;s modification time</a> for this value, or a hash representation of the file as a whole (e.g., run the file&#8217;s contents through an MD5 function). My server was providing ETags for all but the main PHP page. This makes sense, because PHP pages aren&#8217;t like static HTML pages: my main PHP page is updated whenever the database it uses for its content is updated.</p><p>One fix would be to have PHP send an ETag header:</p><pre>header("ETag: \"representative value\"");</pre><p>As already written, the representative value could be any of the following:</p><ul><li>The modification time of the last database record used by the page</li><li>An MD5 representation of the entire page, including the database-driven content</li><li>An MD5 representation of just the most recent database record that&#8217;s reflected on the page.</li></ul><p>And the answer I came up with was&#8230;just to ignore ETags on this PHP page. Coming up with any of those values would require a decent rewrite of the entire page, something I just don&#8217;t feel like doing right now. And, in my defense, my score turned out pretty well after I addressed the JavaScript and CSS compression issue&#8230;</p><p>Another reason I lost points was because two of the files being sent (the JavaScript and the CSS) weren&#8217;t being compressed. Most of my site uses PHP, which uses the zlib library to compress data sent to the browser. So PHP on the server compacts the HTML, it gets sent to the browser in compressed format, then the browser decompresses it and reads it. That&#8217;s great and generally recommended, but the JavaScript and CSS pages aren&#8217;t being handled by PHP. One solution is to use Apache&#8217;s mod_gzip or mod_deflate module to compress CSS and JavaScript files. To do that, add this code to an .htaccess or .conf file:</p><pre>&lt;IfModule mod_deflate.c&gt;
&lt;FilesMatch "\.(js|css)$"&gt;
SetOutputFilter DEFLATE
&lt;/FilesMatch&gt;
&lt;/IfModule&gt;</pre><p>That code basically says if mod_deflate is loaded, any file that ends with .js or .css should be ouptut using the deflate filter.</p><p>After I took all these steps, I got my YSlow grade up to a 98! I&#8217;m pretty pleased with that result. Also, in more concrete terms, if a user accesses my home page for the first time, they perform 4 HTTP requests and download just over 21KB of data. Subsequent requests of that same page require only 1 HTTP request and 3KB of data to be downloaded. That should make a big difference.</p><p>To wrap up this thread, I&#8217;ll mention two things. First, the YSlow plug-in and report is a very useful tool, but it&#8217;s not the only test or indicator of a site&#8217;s performance. I do think it&#8217;s a great place to start, though. Second, in researching some of these fixes, I came across several other sites where people did the same thing I did (tested their site using YSlow, then tried to address the problems). If you&#8217;re interested in this process, you may want to search online to read some of those other articles.</p><p>(As a post-script, I will add that one can improve the ETag score by disabling ETags in Apache, strange as this may seem. By doing so, it forces browsers to rely upon the caching headers. So if you can&#8217;t or don&#8217;t want to get ETags to work, turn them off and they won&#8217;t cause a problem.)</p><p>As always, thanks for reading and let me know if you have any questions.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/01/22/speeding-up-web-sites-using-yahoo-yslow-part-3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <series:name><![CDATA[Speeding Up Web Sites using Yahoo!'s YSlow]]></series:name> </item> </channel> </rss>
<!-- Served from: www.larryullman.com @ 2012-02-05 14:37:00 by W3 Total Cache -->
