1

We have developed a Windows C++ console based network intensive application, which seems to be slow during data communication.

The code base is huge, so I am looking for a profiler tool which can point to specific functions/line of code which are bottleneck to overall performance.

I tried using "Performance Tool" available in VS 2010, but it crashes the moment I run to profile the application.

Error Message: Injection of Runtime library failed.

Also, I tried using Very Sleepy, but I cannot see my functions in it, may be because it cannot point to source code (But not sure, may be I mightnot be using it correctly)

Can someone suggest some good freely available profilers for Windows C++ console based application?

Based on evaluation, we would proceed for commercial version of profiler as well.

Many Thanks in Advance.

Rohit
  • 6,941
  • 17
  • 58
  • 102

3 Answers3

4

If you are using an Intel based machine, I'd use VTune. If it's on an AMD machine, CodeAnalyst is the similar product.

I believe VTune is available on a trial license. CodeAnalyst is available for free.

These tools are not console-based, but they will work for profiling console based applications.

Mats Petersson
  • 126,704
  • 14
  • 140
  • 227
1

There are likely to be several "problems", or ways to make it faster. I wouldn't call them "bottlenecks" because often they are not localized. Typically they are perfectly good code - it was just never supposed that they would be on the "critical path".

Suppose the problems, when fixed, would save these percentages:

enter image description here

Just finding one of them would give you a certain amount of speedup. Like if you just find A, that would give you a speedup of 1/(1-0.3) = 1.43 or 43%. If you did that, you could, like most people, be happy and stop. However, if you continued and also found B, your total speedup would be 1/(1-0.51) = 2.04 or 104%. That's a lot more than 43%, even though B was smaller than A. Fixing C brings you up to 2.92 times faster, and D brings you to 4.2 times faster.

What? Fixing smaller problems has higher payoff? They can, because speedup factors compound. Fixing A and B in that order gives you 1.43 * 1.43 = 2.04. If you happen to fix them in the opposite order you get 1.27 * 1.61 = 2.04

Each time you fix something, the other issues become larger, percentage-wise and easier to find, and the speedups accumulate like a high-yield investment. By the time you fix A, B, C, D, and E, the one left is F and it isn't 5%, it's 30%. Fix all of them, and now you are 8.5 times faster! However, if you miss one, like D, because your profiling tool fails to expose it, you are only 4.5 times faster.

That's the price you pay for not finding a problem.

That's why I rely on a manual technique, because, relative to profilers, it finds all problems they find, and it finds ones they don't. Profilers are often concerned with peripheral issues, like accuracy of measurement, which doesn't help to find problems. If you're wondering why, here's the math.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135
0

Our C++ Profiler tool should work.

It doesn't care how your application does I/O (e.g., "console based"). It handles huge systems of files. It also handles GNU and MS dialects of C++, as well as C++11.

Commercial. (I doubt you'll find a free profiler that works for MS Visual C++).

Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
  • can it be used for evaluation purpose, before we plan to purchase – Rohit Mar 12 '13 at 09:31
  • There is a evaluation download at the site. You can run that to learn how it operates, but it won't process your giant program during the evaluation. – Ira Baxter Mar 12 '13 at 09:33