

Locating CPU-intensive code in Node.js - dmitrim
http://nodetime.com/blog/cpu-profiling-with-nodetime

======
cliftonk
Tip to make the stack traces better in javascript: name all of your anonymous
functions.

For example,

    
    
        request.on('data', function requestReceivedData() { ... });

~~~
firefoxman1
I've recently started doing this as well. You also get a performance boost if
you define the functions once at the top and then do this:

    
    
       request.on('data', requestReceivedData)

------
klr
Really great. I'd like to do all that locally though.

~~~
htilford
by default nodetime reports back to nodetime.com to display the results. But
that's just the default. It can be set to report to any server and/or the
console.

------
rektide
for the more DIY, hrtime.cputime() works great too.

