How To Do Performance Profiling in Visual Studio 2

2019-04-28 10:49发布

Microsoft make this piece of software called "Visual Studio 2008 Professional". I have found that there doesn't appear to be an application performance profiler or something similar in it, making it seem not so "professional" to me.

If Microsoft don't include a profiler, what are your third party options for time profiling for Visual Studio 2008? Free would be preferable, as this is for uni student purposes :P

8条回答
Emotional °昔
2楼-- · 2019-04-28 11:07

Personally, I use the Red Gate profiler.

Others swear by the JetBrains one.

Those seem to be the options, and there isn't much between them.

查看更多
Evening l夕情丶
3楼-- · 2019-04-28 11:07

I use the Team System Edition. That comes with a profiler which is pretty good. There are other options out there:

Hope that helps. Note: None of them are free.

Happy profiling :)

查看更多
小情绪 Triste *
4楼-- · 2019-04-28 11:08

I use JetBrain's dotTrace and it works quite well.

查看更多
闹够了就滚
5楼-- · 2019-04-28 11:16

same answer as:

Re-edited: You asked what your options were. If your heart is set on profiling, then look for a profiler.

On the other hand, if you actually have a performance problem to find, the simple method works as well or better than nearly every profiler. I say nearly every, because in some profilers you can actually tease out what you need to know, which is the time-cost attributable to individual instructions, especially call instructions.

The time-cost of an instruction is the amount of time that would be saved if the instruction could be removed, and a good estimate of it is the fraction of call stack samples containing it. You don't need to estimate that fraction with high precision. If the instruction is on 5 out of 10 samples, it's cost is probably somewhere in the range 45% to 55%. No matter - if you could get rid of it, you would save its cost.

So finding performance problems is not hard. Just take a number of call stack samples, collect the set of instructions on those samples, and rank the instructions by the fraction of samples containing them. Among the high-fraction instructions are some that you could optimize away, and you don't have to guess where they are.

I'm simplifying somewhat, because often it is helpful to examine more state information than just the call stack, to see if some work being done is really necessary. But I hope the point is made.

People express doubt that it could work in the presence of recursion, or work on large programs. A little thought (and experimentation) shows those objections do not hold water.

查看更多
Rolldiameter
6楼-- · 2019-04-28 11:19

I use JetBrains dotTrace profiler. This is a commercial profiler. (Full disclosure: I receive a free licence as an MVP. It has proved very useful though.)

There's also the free CLR Profiler for .NET 2.0 and an article explaining how to use it.

查看更多
登录 后发表回答