Archive for the Performance Category

Beyond YSlow

| July 8th, 2008

Nicole and Stoyan, part of the Exceptional Performance team at Yahoo!, recently gave a talk on some of the new performance rules related to javascript, css, mobile and more. The focus of the talk was on how one can improve performance further even after getting an ‘A’ grade on yslow. Enjoy the talk.



Performance Juice

| July 2nd, 2008

In the company of *exceptional* people at the Exceptional Performance Group, I too have caught on the performance bug. I asked myself today – “Wouldn’t it be great to have all the performance blogs consolidated at one place”. There are a number of performance experts (both frontend and backend) outside of Yahoo!. I do have a couple of such blogs on my feedreader and I’m sure you to have some to share.

I’m trying to consolidate all such performance centric blogs at Performance Juice. While I’m busy scouring the web for some great blogs I may have missed, I would love to include any links you might have into Performance Juice. You can contribute by listing blogs into the spreadsheet below. You can edit the spreadsheet here. Lets make Performance Juice a community driven vertical search for anything performance.

Be sure to quench your performance thirst at Performance Juice or just subscribe to this feed and stay up to date on the performance karma.

There are many performance related posts we come across everyday which are not necessarily from performance centric blogs. If you come across any such great posts, just tag them as “performancejuice” on del.icio.us and I’ll make sure they are included.

Any volunteers to manage the search engine? Head here.

[UPDATE] The custom search is now also powered by performance bookmarks on del.icio.us.

You can edit the spreadsheet here.

Read the Memcached Documentation here.

Memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

I have been exploring Memcached as a prospective cache for my project. It seems to be the panacea for all my caching problems. What is missing though is a detailed explanation or HowTo’s. I have been scouring the mailing list and the web for getting a detailed explanation on its working. I have aggregated all such information into a document which could be used by others like me in understanding Memcached.

I will be updating this document as and when I find something that would aid in understanding Memcahed better.

Read the Memcached Documentation here.

Although the ubiquitous $() function of prototype.js helps developers from retyping the DOM methods for getting an element, it should be used with utmost care. As they say ‘the devil’s in the details‘, we take a look at the protoype definition for $():

function $() {
var elements = new Array();

for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; }

As we see above, the document.getElementById(element) is called on every function call. Therefore all the $() function does is facilitate code resuse.

But I have seen developers use the $() without regard to its implementation just because its handy, short and sweet. People tend to write code like the following:

for(var i=0; i< $('element').length; i++) { var value = $('element').value; ....... } Here in effect, for every iteration the DOM dynamically looks up for the element. This is inefficient which can be avoided using Object Caching (storing the objects referenced many times into a local variable). Here is the same code using object caching:

var element = $(‘element’);
for(var i=0; i
var value = element.value;
……..
}

Sometimes these minute details can make a big difference.