Welcome, guest Sign In

Yahoo! Developer Network Blog

« Previous | Main | Next »


July 29, 2010

Boomerang and the WebTiming API

The WebTiming spec — proposed by Google to the W3C — is an important step forward in measuring a Web page's round-trip time (the time between a user requesting a page and the page becoming usable).

In the past, we've had to either approximate the value by putting a timer at the start of our document, or use a cookie to store the time when the previous page's onbeforeunload* event fired. Both approaches have their problems.

In the first case, the time measured tends to ignore the time it takes for the browser to do DNS lookups, open TCP connections, deal with TCP slowstart, and deal with latency introduced by the server-side application.

The second case excludes any traffic that either had no onbeforeunload event (such as bookmarks or non-web clients) or had an onbeforeunload event that we couldn't control (such as links from sites outside our domain).

When developing boomerang, we chose the latter approach. Even though we get fewer data points, the data is more representative of what users experience.

The introduction of the WebTiming API fixes the downside of this choice. If boomerang determines that it could not set t_start (the time that navigation started), then it checks to see if the user's browser supports the WebTiming API. If it does, boomerang pulls the time out of the timing object.

At the time of this writing, Internet Explorer 9 supports WebTiming in the window.msPerformance object. Google has announced plans to support the window.webkitPerformance object, and Mozilla will probably add window.mozPerformance to Firefox. No word from Opera yet. Older versions of Chrome supported a window.csi() method that exposed similar information, but with a different API.

I'm also pleased to note that with Commit 83f776772c9604023b3, boomerang supports all of these implementations, in addition to its own cookie-based measures.

So, go fork boomerang, use it, hack it, tell us what you like, fix what you don't. It's BSD licensed.

*Opera doesn't support onbeforeunload, so on Opera we use the onunload event instead.

Philip Tellis Philip Tellis (@bluesmoon)
Doing stuff at Yahoo!

Posted at July 29, 2010 2:00 PM | Permalink

Bookmark this on Delicious

Comments

Post a comment

Comment Policy: We encourage comments and look forward to hearing from you. Please note that Yahoo! may, in our sole discretion, remove comments if they are off topic, inappropriate, or otherwise violate our Terms of Service. Fields marked with asterisk '*' are required.

Remember Me?

Subscribe

YDN Blog: Get Yahoo! Developer Network Blog on your personalized My Yahoo! home page.

Add To My RSS Feed

YDN Link Blog: Get Yahoo! Developer Network Linkblog on your personalized My Yahoo! home page.

Add To My RSS Feed

Recent Readers

YDN Libraries & Best Practices

  • ASTRA
  • Design Pattern Library
  • Exceptional Performance
  • Yahoo! User Interface Library (YUI)

Copyright © 2010 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy | Terms of Use

Help us continue to improve the Yahoo! Developer Network: Send Your Suggestions