Recommendations for C Profilers?

后端 未结 6 1117
逝去的感伤
逝去的感伤 2020-12-04 11:16

Everyone always says to profile your program before performing optimizations but no-one ever describes how to do so.

What are your practices for profiling C code?

6条回答
  •  难免孤独
    2020-12-04 11:55

    If you are using Linux, then I recommend the combination of ValGrind and CallGrind and KCacheGrind. ValGrind is a superb method for finding memory leaks, and the CallGrind extension makes for a good profiler.

    NOTE: I just learned that ValGrind now also works on Mac OSX. However, CallGrind and KCacheGrind haven't been updated since 2005. You might want to look at other front-ends.

提交回复
热议问题