Sunday, March 30, 2008

Massively distributed Ajax profiling

Emre Kiciman and Ben Livshits have a SOSP 2007 paper, "AjaxScope: A Platform for Remotely Monitoring the Client-Side Behavior of Web 2.0 Applications" (PDF), with the clever idea of using web browser clients to help do massively distributed instrumentation and performance optimization of Web 2.0 applications.

Some excerpts from the paper:
AjaxScope ... [allows] instrumenting and remotely monitoring the client-side execution of web applications within users' browsers .... at the source code level to improve developers' visibility into ... correctness and performance.

We take advantage of ... the ability to dynamically serve new, different versions of the code each time any user runs a web application ... to ... provide differently instrumented code per user and per execution of an application.

Instrumentation is dynamically added or removed from a program as its real-world behavior is observed across users. We [also] distribute instrumentation and run-time analyses across many users' execution of an application ... A combination of these techniques allows us to take ... runtime monitoring policies that would normally impose a prohibitively high overhead and instead spread the overhead across users and time.

Because our prototype can parse and rewrite standard JavaScript code, it does not require changes to the server-side infrastructure of web applications, nor does it require any extra plug-ins or extensions on the client browser.

To our knowledge, AjaxScope is the first to extend the developer's visibility into web application behavior onto the end-user's desktop ... in that it allows developers to gain insight into application behavior in a wide-area setting.
The paper goes on to give several examples of doing instrumentation with AjaxScope including reporting client-side errors, detecting infinite loops, optimizing string concatenation, finding memory leaks, and looking for opportunities for static caching.

Update: About a year later, Microsoft made parts of AjaxView, a similar toolkit, available for download.

No comments: