Profiling network software / Profiling software wi

2019-05-21 05:25发布

I'm working on a complex network software and I have trouble determining how to improve the systems performance.

Specifically in one part of the software which is using blocking synchronous calls. Since this part of the system is doing heavy computations it's nearly impossible to determine whether the slowness of this component is caused by these computations or the waiting for the other parts of the system.

Are there any light-weight profilers that can capture this information? I can't use heavy duty profile like valgrind since that would completely skew the results (although valgrind would be perfect, since it captures all the required information).

I tried using oProfile but I just wasn't able to get any meaningful results out of it (perhaps if there is a concise tutorial somewhere...).

3条回答
我欲成王,谁敢阻挡
2楼-- · 2019-05-21 05:52

Comment out your "heavy computations" and see if it's still slow. That will tell you if it's waiting on other systems over the network or the computations. The answer may not be either/or and may just be an accumulation of things.

查看更多
3楼-- · 2019-05-21 05:53

What you need is something that gives you stack samples, on wall-clock time (not just CPU time like gprof), and reports by line (not just by function) the percent of samples containing the line.

Zoom will do it, but I just do random-pausing. Here's why it works. Here's a blow-by-blow example. Here's another explanation.

查看更多
迷人小祖宗
4楼-- · 2019-05-21 05:55

You could also do some old fashioned printf debugging and print the time before and after executing the function to standard output or syslog. That is about as light-weight as profiling gets.

查看更多
登录 后发表回答