开发者

Optimization: A tool like gprof for visual studio

开发者 https://www.devze.com 2022-12-21 03:28 出处:网络
As a C# programmer, i\'m in a transition from small projects to medium projects. I didn\'t need a profiler for my little projects before. But now I need a tool that help me improving the performance o

As a C# programmer, i'm in a transition from small projects to medium projects. I didn't need a profiler for my little projects before. But now I need a tool that help me improving the performance of my code. I used gprof many years ago, in C.

Can someone give me a starting point开发者_如何学编程, or recommend me a tool like gprof for VS2008? That is: A tool that counts how many times every function has been called, and how many time It's spended in every function. No matter if a had to pay for it (under certains limits).

Any other advice about how to locate portions of code that should be optimized will be great.

Thanks.


Visual Studio has this functionality built in depending on the version you are using. Within Professional (I believe), you have the Profiling section which gives you timing within functions inclusive and exclusive of further calls, # of calls etc...

It is normally located under the 'Analyze' menu option if it's there.

EDIT

Come VS2010 this has also been greatly improved. Featuring some very cool looking multi-threaded performance analysis, showing you what sort of operations the thread spends its time doing/blocking on. It also displays line by line timings I believe within your code (certainly the last screenshot I saw did).


Check out the Ants profiler


Any other advice about how to locate portions of code that should be optimized will be great.

You can do better than gprof or anything that acts like it.

Here's a quick-and-dirty explanation, including a link to the original gprof paper, and an explanation of what it does and does not do.

Here's an example.


I've used DotTrace and AQTime both are easy to use and understand.

0

精彩评论

暂无评论...
验证码 换一张
取 消