4 ms·
Locating CPU-intensive code in Node.js
- cliftonk 14y agoTip to make the stack traces better in javascript: name all of your anonymous functions. For example, request.on('data', function requestReceivedData() { ... });
- firefoxman1 14y agoI'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 14y agoReally great. I'd like to do all that locally though.
- htilford 14y agoby 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.
- grannyg00se 14y agoIs there some indication as to why you wouldn't be able to?
- rektide 14y agofor the more DIY, hrtime.cputime() works great too.