Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有运行 5 小时的 CPU 绑定进程(使用 CPU 时间getrusage())
getrusage()
我试图通过 gprof 对其进行分析。总共花费的时间main()只有大约 5000 秒。
main()
我的程序受 CPU 限制,它有一些磁盘 IO,但并不重要。配置文件中断已打开,并且我的进程不是多线程的。
它只在它知道的例程中采样。你打电话new?那会花时间在gprof不去的地方。
new
gprof
顺便说一句,如果您正在寻找节省时间的方法(我会在 5 小时后),您可以做得更好。