How Hotmail Was Made 10x Faster?

Dick Craddock over at Inside Windows Live blog walks us through some recent work the team has done on Hotmail.Making Hotmail fast"We trimmed content on our pages to speed up download time, and we eliminated a network round trip on login for further gains. The approach we decided to take was to get user data […]

Dick Craddock over at Inside Windows Live blog walks us through some recent work the team has done on Hotmail.

Making Hotmail fast
"We trimmed content on our pages to speed up download time, and we eliminated a network round trip on login for further gains. The approach we decided to take was to get user data closer to the browser, and when the data isn't available on the browser, get it there more efficiently, without the user noticing. We also decided to take advantage of modern browsers like IE9 to be more app-like, by doing more work in the browser and less on the server," Dick Craddock stated.

"The new Hotmail is more app-like, because we now cache information after it's downloaded. The message list is stored in the browser's DOM (Document Object Model), so when we need it, we don't have to download it. We also cache the email that you've read, so we can re-open the message nearly instantly," explains Craddock.

Citing some impressive speed improvements. By modernizing Hotmail to make better use of:

Caching
When caching data, the trick is in knowing when to update it. In the new Hotmail, our server detects when your account changes - for instance, when a new message is delivered - and it sends a notification to the browser. The browser then retrieves the updated data, so your inbox is never out of sync.

Finally, when you close your browser or sign out of Hotmail, the cache is cleared so that data is never left behind to compromise your privacy.

Pre-loading
In the new Hotmail, we download and cache the first few messages so they're ready when you need them. That way, when you choose a message to open, you don't have to wait for the download. Also, in the new Hotmail, while you're reading one message, we automatically download and cache the next one in the list.

If you don't see this feature and you'd like to turn it on for your account, you can do so from an options page.

In additon, we also preload code and data in the browser. "For instance, we know that most Hotmail sessions involve sending email. So while you're reading and deleting email, we download and cache the JavaScript and HTML code and address book data that you need for composing a new email message. When you click New or Reply, we just swap in the cached Compose code and data, and it's ready instantly," Craddock explained.

Asynchronous operations
The new Hotmail no longer waits for server responses for most operations before updating the UI. In the new Hotmail, when you delete a message, Hotmail updates the message list instantly, and you can resume working right away. In the background, client code queues up actions and calls the server to delete the email. So email still gets deleted, but without the wait.

This approach also makes the client code more resilient to spikes in server activity and improves performance for users who've low bandwidth/high latency connections.

Finally, "we also looked at the great improvements made by the IE9 team and invested in ways to make Hotmail run even faster on IE, such as using IE9 Standards Mode," Craddock added.

Results: The following data represents 75th percentile measurements from hundreds of runs of an automated test against a production server. Bandwidth is 300kb down/75 kb up/150ms latency, and browser is IE9. Your results may vary.

Here's a video that shows it more clearly:

[Source:Inside Windows Live]