How do you profile your code?

后端 未结 9 1860
小鲜肉
小鲜肉 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:08

    Windows (.NET and Native Exes): AQTime is a great tool for the money. Standalone or as a Visual Studio plugin.

    Java: I'm a fan of JProfiler. Again, can run standalone or as an Eclipse (or various other IDEs) plugin.

    I believe both have trial versions.

    0 讨论(0)
  • 2020-12-23 19:08

    The Google Perftools are extremely useful in this regard.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题