即时EMAIL: 我们怎么让Hotmail快了10倍

We announced last week a new version of SkyDrive, in which SkyDrive was redesigned from the ground up to have great performance on modern browsers. Like the SkyDrive team, we’ve also been hard at work on ways to speed up Hotmail.

We measured how fast our Hotmail pages loaded all over the world and how we compared to our competitors in a standardized environment, and then we dug deep into the numbers. In some ways, we were pretty good, but a number of very common actions were just too slow.

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. But our goal was to make Hotmail feel instant, and we knew that speeding up downloads would only get us so far towards that goal. Even with today’s broadband speeds, the network is the bottleneck, and we needed to keep our customers from experiencing that latency.

The approach we decided to take was to get user data closer to the browser, and when the data is not available on the browser, get it there more efficiently, without the user noticing. We also decided to take advantage of modern browsers like Internet Explorer 9 to be more app-like, by doing more work in the browser and less on the server.

We identified three specific techniques to follow: caching, preloading, and asynchronous operations.

Caching

The old Hotmail requested fresh data from the server every time it was needed. For instance, when you signed in to the inbox, Hotmail would ask the server for the latest message list. When you opened and then closed a message, we would make you wait while we asked the server for the message list again. Similarly, if you opened that same message again, we would make you wait while we retrieved the message.

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.

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

Our analysis of usage patterns of Hotmail showed that when customers sign in to their inbox, the first thing they’re likely to do is read the subject lines of new mail to decide which messages to open. In the new Hotmail, we use that time to 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.

Our analysis also showed that when customers open an email message, they’re very likely also to view the one that follows it. So, in the new Hotmail, while you’re reading one message, we automatically download and cache the next one in the list.

We’re continuing to fine-tune our design to make this as efficient as possible, so not all users have this feature turned on by default yet.  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 addition to pre-loading messages, 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.

An interesting design problem we faced was to figure out how to download content without interfering with bandwidth or browser threading utilization. If done poorly, the app can feel non-responsive. We’ve separated and ordered the downloads to make the browser responsive, and to make the most important user tasks fast and available as early as possible. This is an area that we will continue to work on for even more gains in the future.

Considering the large number of Hotmail users, other challenges we faced were keeping our servers from being overloaded, and keeping the service cost efficient. We’ve had to invest in squeezing out more throughput from our storage system—we’ll describe how we did this in a future post.

Asynchronous operations

The old Hotmail used to wait for server responses before updating the UI. For example, when you deleted an email message, Hotmail would call the server and tell it to delete the message, and then wait for a response from the server before updating the message list. This made Hotmail feel slow, because you felt you had to wait for the operation to complete before you could continue working.

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 have 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.

Results

We wrapped up these changes a few weeks ago, and just finished releasing the code to all our users (with the exception of the pre-loading feature, which, as mentioned above, is not yet turned on by default in some markets). So, what did we accomplish? The data speaks for itself:

 

Hotmail 
Dec ‘10

Hotmail 
June ‘11

Open message

3.3 seconds

0.18 seconds

Delete message

3.1 seconds

0.14 seconds

Compose new message

4.3 seconds

0.20 seconds

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.

But, we’re not done. We believe performance is a feature, and we’re committed to making Hotmail as fast as possible. We will continue to find more ways to make Hotmail load faster, and we’re also working on ways to improve the efficiency of even more of the most common actions.

Enjoy the improvements, and watch this space for more to come.

Dick Craddock 
Group Program Manager, Hotmail


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值