jQuery in Nanoseconds

August 28th, 2007

In my GTAC lightning talk, I mentioned that there’s a DTrace-instrumented version of Spidermonkey. Well, now there are patches that will add it to the main tree for Solaris builds.

I decided to try it out on some slightly modified jQuery benchmark code.

It’s easy to see chrome JS code that executes after the jQuery setTimeout calls. Also, there’s a large delta as we’re setting those up. If you take a look at the HTML page, you’ll see there’s a loop that creates 10000 arrays before the last call to time().

2 Responses to “jQuery in Nanoseconds”

  1. Bryan Cantrill Says:

    Very cool! One thing that we’ve been talking about (that I notice you are effectively doing here) is the ability to statically define probes in JavaScript. The Java folks have done this recently with their JSDT provider, and it seems that a JSSDT provider would be quite valuable. Anyway, it’s great to see you putting DTrace to use! And hopefully that output is as useful to you as it seems it would be…

  2. Brendan Gregg Says:

    Great work! Those jumps in delta time look interesting – is that time spent in libmozjs? libxul? disk or network I/O? the kernel? drivers? DTrace can answer all of these. :)

    Probes based on the following could be added to that flow script, for visibility into the rest of the software stack,

    pid:libmozjs::entry,pid:libmozjs::return – libmozjs
    pid:libxul::entry,pid:libxul::return – libxul
    syscall:::entry,syscall:::return – I/O
    io:::start,io:::done – disk I/O
    mib::: – network I/O
    fbt:::entry,fbt:::return – kernel (if needed!)