Hacker News new | past | comments | ask | show | jobs | submit login
Locating CPU-intensive code in Node.js (nodetime.com)
24 points by dmitrim on May 21, 2012 | hide | past | favorite | 6 comments



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

For example,

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


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)


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


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.


Is there some indication as to why you wouldn't be able to?


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




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: