Posts tagged ‘performance’

I’m a published author!

One of my life goals is to write a book. I recently came one step closer to that goal with a contribution to the new Web Performance Daybook Volume 2 from O’Reilly.

The project started out of Stoyan Stefanov‘s Performance Calendar which was a series of articles from a bunch of us in the performance industry. The articles are now published in one handy collection containing lots of insights from some of the smartest people I know. I was honored to participate in this project and wrote Chapter 7 titled “Automating Website Performance”.

The authors’ royalties will be donated to a Web Performance charity so grab a copy for everyone in your organization (Paperback, Kindle). You’ll be benefiting a good cause and learning at the same time!

 1 comment

O’Reilly interview about Torbit

I recently attended and spoke at the Velocity Conference. While I was there, Mac Slocum grabbed me and we spent a few minutes talking about mobile performance. Mac is the Online Managing Editor for O’Reilly and it was fun to get to share some of the ways we are thinking about mobile performance at Torbit. The video is less than 5 minutes long. Check it out.

 1 comment

Speaking at Velocity Conference

In a couple weeks I’ll be speaking at O’Reilly’s 2011 Velocity Conference. Velocity is an annual gathering of people who care a lot about web performance. The tagline this year is “Automated, Optimized, Ubiquitous”. Of course, “Automated” describes nicely what we’re doing at Torbit — taking cutting-edge performance techniques and making them available to anyone with a website. I’ll be speaking on the 15th and I’m looking forward to sharing some of the things we’ve learned.

The conference is taking place in Santa Clara, CA on June 14-16. Each year Velocity attracts the best known names in the industry and speakers from companies like Google, Yahoo and Microsoft present their latest research and findings. The schedule is crammed with great content and I’m honored to be included on the roster. My talk will focus on mobile optimizations and I’ll be going into more detail on the new localStorage optimizations we have developed at Torbit for delivering amazing mobile performance.

I’m looking forward to the event and I hope to see lots of familiar faces there on June 14th. Let me know if you’re planning to attend as I’d love to meet up and make lots of new friends while I’m there.


Guest post on TechCrunch: How fast is your site?

On Friday I had the privilege of writing my second guest post for TechCrunch. My article was titled How Fast Is Your Site? Measure It With Google’s Page Speed Online. I talked about the new Page Speed Online tool from Google and how you can use it to analyze the performance of your website. It’s been a while since I’ve written for TechCrunch and it’s always fun to write for an audience of millions. A huge thanks to Erick Schonfeld for giving me the opportunity and helping me get my commas in the right places. I seriously wish he could edit everything I write.

I believe we are still in the early days of web performance optimization. Most people aren’t aware of how slow their sites are or how much their performance is hurting them. A big part of my job as CEO of Torbit is educating people on why speed matters. People need to understand the problem before they can be sold a solution. Tools like Page Speed Online make my job easier by showing people their sites aren’t as fast as they could be. The statistics are out there and the correlation between performance and revenue is undeniable. You’re losing money if your site is slow.

One person who “gets it” is Micah Baldwin. Micah added Torbit to his site a few weeks ago and reported a noticeable speed improvement as a result. He left a comment on my TechCrunch post that says:

It’s amazing how much speed matters. We have found a direct link to pageviews and revenue.

I’m stoked to be helping people like Micah get faster sites, increased pageviews and more money. We’re building an automated solution to fix slow sites and are making a lot of progress. We’ve got a ton of people on our waiting list and are looking forward to opening up our BETA soon. The technology isn’t trivial, but it sure feels good to be working on something that really matters.


Queue events that occur before JavaScript is loaded

One of the common recommendations for speeding up your website is to put your JavaScript at the bottom of your page instead of including it inside the head tag. The difference this simple placement can have is impressive, especially if you are dealing with sizable JavaScript libraries that are usually 50k at best.

One downside with putting your JavaScript at the bottom is that your fast clicking visitors may click on links that won’t work. The reason this happens is because the JavaScript that those links trigger hasn’t been downloaded yet. Usually those links will work on the second or third try, but it makes for a bad user experience and a poor first impression.

I decided to fix it by queuing up those user-triggered actions and replaying them as soon as the document is ready. I wrote a wrapper that I can use anytime I have code that depends on my JavaScript being downloaded and available.

The concept is simple. Instead of calling functions directly when a user triggers an action, I add the function call to a queue. When the document is ready, I loop through the queue and execute each of the actions in the order that they occurred. I put this code inline inside my head tag so it is available as soon possible. The rest of my JavaScript can then be included right before the closing body tag without worrying about this race condition between the browser and website visitor.

<script type="text/javascript">

var loaded = false;
var action_queue = new Array();

function when_ready(callback) {
    // skip the queue if the document has already loaded
    if (loaded == true)
    else {

function dequeue_actions() {
    for (i in action_queue) {
        delete(action_queue[i]); // cleanup after ourselves
    loaded = true;


I then trigger dequeue_actions() as soon as the document is ready:

// using jQuery

// this works too
onload = dequeue_actions;

You can then safely make function calls using when_ready(). For example:

<a onclick="select('foo')">foo</a>


<a onclick="when_ready('select(\'foo\')')">foo</a>

In my testing, the results have been very smooth with delays being almost unnoticeable. Of course, your experience will vary depending on the size of your document and how long it takes for your document to be ready.

This code is pure JavaScript and should work in every modern browser. I’ve tested it in IE6+, FF2+ and Safari 3+.


How to speed up your website

There are few things as frustrating as having to wait for a website to load.  Not only do slow websites make for a poor user experience, they can also have a big impact on your bottom line:

  • Google discovered that adding 500ms to their load time resulted in a 20% loss in page views.
  • Amazon discovered that every 100ms they added resulted in a 1% loss of conversions.

Steve Souders is the main thought leader on how to make websites splitting fast.  Steve works at Google, but before that he worked at Yahoo on an extremely useful project called YSlow.   I have used a lot of his research to speed up my own projects and he’s taught me a lot of simple things that can make a big difference in web performance.

Steve recently taught a class at Stanford on high performance websites and the videos are available online.   The full set costs $600, but you can watch the first 3 for free.  I would recommend anyone building stuff on the web to take the time to watch and learn.

Update 06/07/09: Google recently announced their own version of YSlow called PageSpeed.  It’s got some additional features that YSlow doesn’t have — like giving you optizimed images that can be saved directly from the plugin.  Check it out.