Twitter, jQuery, and Performance

January 21, 2011 § Leave a comment

This writeup by John Resig concerning Twitter’s recent performance problems is an interesting read. It points out that some changes in jQuery 1.43 were responsible for part of the performance degradation, but the larger problem had more to do with how jQuery was being used. John points out two things that we would all do well to pay attention to.

  1. It’s a very, very, bad idea to attach handlers to the window scroll event.
  2. Always cache the selector queries that you’re re-using.

If you’d like to explore this topic further, this jQuery performance optimization video by Addy Osmani is great. You’ll need to block off half an hour or so to watch it, but it offers some excellent tips that are really useful if you’re in and out of jQuery on a regular basis.

About these ads

Tagged: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Twitter, jQuery, and Performance at Mike Vallotton's Blog.

meta

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: