最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - How can I alter the polling interval when using node --prof? - Stack Overflow

programmeradmin0浏览0评论

I have a node program I'd like to profile. If I use --prof I can get a profile output (isolate-xxx) that I can process with node --prof-process. Unfortunately, since the program is fairly quick (although still a lot slower than I'd like - it's around ~2s when I think it should be in the millisecond range - otherwise I wouldn't bother profiling), the profile isn't particularly granular. There is an option --cpu-prof-interval which should allow finer-grained profiling but that only appears to work with --cpu-prof not --prof and the output of that doesn't work with --prof-process

Is there a way to either:

  • Get a more granular output with --prof?
  • Get the CPU prof output to work with --prof-process?

I have a node program I'd like to profile. If I use --prof I can get a profile output (isolate-xxx) that I can process with node --prof-process. Unfortunately, since the program is fairly quick (although still a lot slower than I'd like - it's around ~2s when I think it should be in the millisecond range - otherwise I wouldn't bother profiling), the profile isn't particularly granular. There is an option --cpu-prof-interval which should allow finer-grained profiling but that only appears to work with --cpu-prof not --prof and the output of that doesn't work with --prof-process

Is there a way to either:

  • Get a more granular output with --prof?
  • Get the CPU prof output to work with --prof-process?
Share Improve this question asked Jan 18 at 11:02 Richard WheeldonRichard Wheeldon 1,11816 silver badges29 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The CPU profile can't be processed by --prof-process but it can be loaded into the developer tools of a browser in the "Performance" tab and viewed there. Would be nice if the docs made that a bit more obvious!

发布评论

评论列表(0)

  1. 暂无评论