How do you profile your code?

后端 未结 9 1941
小鲜肉
小鲜肉 2020-12-23 18:14

I hope not everyone is using Rational Purify.

So what do you do when you want to measure:

  • time taken by a function
  • peak memory usage
9条回答
  •  旧巷少年郎
    2020-12-23 19:11

    You probably want different tools for performance profiling and code coverage.

    For profiling I prefer Shark on MacOSX. It is free from Apple and very good. If your app is vanilla C you should be able to use it, if you can get hold of a Mac.

    For profiling on Windows you can use LTProf. Cheap, but not great: http://successfulsoftware.net/2007/12/18/optimising-your-application/

    (I think Microsoft are really shooting themself in the foot by not providing a decent profiler with the cheaper versions of Visual Studio.)

    For coverage I prefer Coverage Validator on Windows: http://successfulsoftware.net/2008/03/10/coverage-validator/ It updates the coverage in real time.

提交回复
热议问题