Look Ma, We Built a Profiler for Node.js

My partner in crime, +Guyon Roche, and I just built a really slick little profiler for Node.js that works surprisingly well. The reason we had to do it is that the current V8 profiler doesn't work with the more recent versions of Node and we need to try to squeeze as much efficiency as we can out of Uber's dispatch server due to the ridiculous amount of growth the service has been experiencing. Six months ago the dispatch server would maybe spike the server's CPU at 1.5 percent, but now it's looking like we're about to run out of headroom. Whoops! ;)

I'll have to talk to Uber about it, but if anyone's interested then I'll check to see if we can open source it or something.

By the way, the profiler has two dependencies: 1. the microtime node library, which provides access to the high-resolution timer on POSIX systems * , and 2. a JS inheritance method created by John Resig, which can be found here ** :

http://ejohn.org/blog/simple-javascript-inheritance/

* If you don't have a POSIX system (Windows), you could maybe extend microtime to access the equivalent Windows high-resolution timer, but I've never written a Node C++ module before, so I don't know how easy or hard that would be. My guess is that it would probably only be an afternoon hack seeing as how many of these half-assed Node.js libraries you see out there.

** If you have your own inheritance library, you could pretty easily replicate what we've done to integrate the profiler with Resig's code, so that probably wouldn't be a big deal either.
Shared publiclyView activity