Monday, August 13th, 2007

Analyzing the .Mac Gallery and speeding it up 4x

Category: Performance

As with everything Apple, there was a lot of buzz about their .Mac Web Gallery, including folk who thought it was too slow.

Steve Brewer looked into the code and has written up his findings which include:

  • How Apple left 128 lines of comments in
  • How the images are used inefficiently
  • How one change brought his testing to a .23ms average vs. Apples 2.1ms average

Posted by Dion Almaer at 5:21 am

2 rating from 90 votes


Comments feed TrackBack URI

Just from visiting the demo gallery on launch day it was clear that it hadn’t been done with performance oriented best-practise at heart, so it’s good to see optimisations coming out so fast!

I thought about using Sliding Doors (SD) as an alternative technique for web-based skimming, but there’s another thing to consider – the time to load the thumbnail for the album. With SD you’re loading in a large image and then positioning it with CSS background properties, so although there’s less browser overhead, and the total time to download all the skimming images is shorter, you’re waiting longer to see the thumbnail for the album itself which is the most important bit. Viewers probably won’t start skimming until most of the page is loaded, so I think it’s more important to get the thumbnails up fast than to have all the skimming ready to go as early as possible.

Comment by Ben — August 13, 2007

Another funny thing – in his launch speech, Steve Jobs said that with this gallery, there’ll be “no more sending DVDs to Grandma”.

Well I hope Grandma has a dual core system, and a 100meg pipe.

Comment by Ben — August 13, 2007

Perhaps a combination of effects might offer the most benefit? Load the first image individually and the rest as a strip so that the first thumbnail is up early.

Comment by Jon Hartmann — August 13, 2007

Its a great example of how simple edits, or even a simpler approach can be dramatically faster.

Comment by Chris Williams — August 13, 2007

I do not claim to be one of the best Javascript writers. I will acknowledge that my own Javascript library is not that great (though it does achieve its purpose in animating several elements simultaneously very well).

However, I noticed very easily that Apple did not even compress the Javascript for their galleries! prototype.js, scriptaculous.js, sproutcore.js, dotmac.js, and gallery.js were all uncompressed! Even the CSS was uncompressed.

All that being said, I thought the gallery was very nice (even if it was bloated). And, I can understand difficulty which they might have in compressing content. My own website currently does not compress the document content – though it compresses everything else.

Comment by Alex — August 13, 2007

Leave a comment

You must be logged in to post a comment.