Performance monitoring tools.

D

developer28

Hi,

I am looking for some performance monitoring tools and was suggested
to ask you for the same.
Can anyone please provide some help on the same?
What i basically want is a tool that can answer some questions like:

Which of the following loops is faster?
for (i=0; i<10000; i++)
for (j=0; j<1000; j++)
{
do something;
}


or

for (j=0; j<1000; j++)
for (i=0; i<10000; i++)
{
do something;
}



Time taken to execute a virtual function call compared to an ordinary
function call?

I know this maybe violating Knuth's law -- "Premature optimization is
the root of all evil" but still would like to know the tool.

Regards,
Aman.
 
I

Ian Collins

developer28 said:
Hi,

I am looking for some performance monitoring tools and was suggested
to ask you for the same.
Can anyone please provide some help on the same?
What i basically want is a tool that can answer some questions like:
<snip>

Use the profiles that comes with your platform or tools.
 
S

Scott Gifford

[...]
What i basically want is a tool that can answer some questions like:

Which of the following loops is faster?
[...]

Time taken to execute a virtual function call compared to an ordinary
function call?

For particular microbenchmarks like this, I often write two small
programs using the two techniques, then use the Unix "time" program to
compare how long they took to complete, how much CPU time they used,
etc.

For finding the actual performance bottlenecks in an application, I
use gprof.

Intel also has some performance tools that look interesting, but
they're not free and I haven't tried them yet.

Hope this helps,

----Scott.
 
D

developer28

[...]
What i basically want is a tool that can answer some questions like:
Which of the following loops is faster?
[...]

Time taken to execute a virtual function call compared to an ordinary
function call?

For particular microbenchmarks like this, I often write two small
programs using the two techniques, then use the Unix "time" program to
compare how long they took to complete, how much CPU time they used,
etc.

For finding the actual performance bottlenecks in an application, I
use gprof.

Intel also has some performance tools that look interesting, but
they're not free and I haven't tried them yet.

Hope this helps,

----Scott.

Hi Scott,

Thanks for the reply and for taking the patience to answer.

But my problem is that i am on a windows XP system so won't be able to
use unix related tools for the same.

Do you have some similar tools for the windows environment?

Regards,
Aman.
 
I

Ian Collins

developer28 said:
But my problem is that i am on a windows XP system so won't be able to
use unix related tools for the same.

Do you have some similar tools for the windows environment?
You'd get better help on a windows programming group, or one for your
tools, which should include a profiler.
 
J

James Kanze

[...]
What i basically want is a tool that can answer some questions like:
Which of the following loops is faster?
[...]
Time taken to execute a virtual function call compared to an ordinary
function call?
For particular microbenchmarks like this, I often write two small
programs using the two techniques, then use the Unix "time" program to
compare how long they took to complete, how much CPU time they used,
etc.

The real problem is eliminating optimization. If the compiler
detects that your loop does nothing, it eliminates it. I use a
special test harness to (try to) avoid this; the actions to be
measured are in a virtual function (which tends to stop the
optimizer, since it cannot determine at the call site which
function is being called), and ensure that all of the operations
in the virtual function affect a value which I store in a member
variable before returning. This seems to be sufficient with the
compilers I currently have access to.

I also use the standard function clock(), rather than the
external function time. From what I've been able to see,
however, this function doesn't work correctly in VC++. (It's
suppose to return the CPU time used; in VC++, my impression is
that it returns wall clock time used.)
Thanks for the reply and for taking the patience to answer.
But my problem is that i am on a windows XP system so won't be able to
use unix related tools for the same.

Why not? The "time" command is a built-in function in bash and
in ksh---both are readily available for Windows. Gprof is also
available for Windows, but your compiler likely includes
something as well, that is tuned for your compiler. (Gprof
needs some help from the compiler.)
 
J

Jerry Coffin

[ ... ]
I also use the standard function clock(), rather than the
external function time. From what I've been able to see,
however, this function doesn't work correctly in VC++. (It's
suppose to return the CPU time used; in VC++, my impression is
that it returns wall clock time used.)

That is, unfortunately, correct. Windows does have a non-standard,
completely non-portable GetProcessTimes(), that does about like you'd
expect on Unix: user time, kernel time, creation time and termination
time (of which, the last two can obviously be used to calculate wall
time).

[ ... ]
Why not? The "time" command is a built-in function in bash and
in ksh---both are readily available for Windows. Gprof is also
available for Windows, but your compiler likely includes
something as well, that is tuned for your compiler. (Gprof
needs some help from the compiler.)

That depends on the compiler. For reasons know only to themselves
(though other have guessed at it) Microsoft no longer includes a
profiler with anything except the extremely high-end (i.e. expensive)
versions of their development tools. One alternative is CompuWare
DevPartner Performance Analyzer Community Edition. Another possibility
is Intel VTune. I haven't used a recent version, but it worked quite
nicely the last time I used it, and I'd imagine if anyting it's gotten
better since then. IIRC, AMD also has a profiler available for free
download though I believe you have to give them an email and such.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top