Re: How to profile a VC++ program?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Carl,

I will look at the multi-thread option, and change it and measure it.
The program is not multi-threaded program at present.

Both methods identified as hotspots are not virtual.

I tried other optimization options as well, like O1, Ox, or the debug
version. The speed are pretty much the same, maybe 10% fluctuation at
most.

These results are shown by a stress testing. Those methods got hit like
100 millions of time, and the whole testing runs about 170 seconds for
the program built with VC.

The program is in C++. The program is designed for best performance.
Mostly home made classes, with some STL. But I only use STL classes at
the place where the CPU usuage is not heavy. Almost no system calls.
Very light IO, I used the standard istream and ostream. It is CPU
heavy, almost no try/catch blocks. The only external library I used is
an external logging library, but I turned off the logging when doing
the testing. The time I measured is about the CPU usage time, not the
actual execution duration time, even though the cpu time and actual
duration time are close to each other in the testing I performed.

The gcc version of the program do not link with multi thread.

The total time of the execution for each build options are
the program execution time when built with VC = 1.7 * when built with
gcc without optimization
and gcc without optimization = 1.5 gcc with optimization.

If the inline methods takes longer time, then it would explain the
speed differences. But then the question why would it be slower. But
since I am measuring the micro seconds here, so I would think it is not
that bad.

Thanks a lot for the interest any way,

John

.



Relevant Pages

  • long(!) Re: need help on CFLAGS in /etc/make.conf please
    ... For example, MPlayer sets this high on purpose, so GCC will actually ... and the K&R compiler would've known exactly the kind of optimization we wanted. ... >> A msg from Richard Coleman, taken together with the GCC 3.x Known Bugs ...
    (freebsd-questions)
  • Re: Critical Performance Issue - Help!
    ... various optimization levels or combinations of compiler flags. ... unless it's precipitating some sort of CPU pathology. ...
    (comp.programming)
  • Re: multiple threads scaling on multiple CPUs
    ... this message -- I had posted this on a GCC group and a suggestion was ... when I run a "debug" compile (i.e. without any optimization flags). ... Here is the general breakdown of user CPU usage ... the more optimized code is going to involve more clashes between ...
    (comp.programming.threads)
  • Re: question on const
    ... const object is modified through a pointer with the const attribute cast ... Others observed that gcc doesn't seem ... to do the optimization that causes the apparently strange result. ...
    (comp.lang.c)
  • Re: How does compare gcc to VS C++ ?
    ... Cel: Microsoft Visual Studio runs only under Windows and only produces ... Comparing VC++ to gcc is like comparing apples to ... IDE under Linux. ... remember what the BSD fortune file has to say about optimization ...
    (comp.os.linux.misc)