Archived

This topic is now archived and is closed to further replies.

The Beholder

Optimizing functions

Recommended Posts

I am about to start optimizing my code for a game, function by function. The thing is: I would like to see how much CPU-time each function/block of code requires. I am using VC++ 6, so I am wondering whether there is a built-in tool in VC++ that can keep track of the processor load in separate code segments, CPU-instructions per function and maybe how much RAM is consumed. If there isn''t a tool for VC++, is there a program (preferably free)that can do these things? (I think I''ve heard of such) Thanks in advance, Gustav

Share this post


Link to post
Share on other sites
What you need is a profiler. There is a shitty one in VC6 that will tell you things like how many milliseconds were spent in the function etc, but it only tells you at the end of execution.

I've written an article at flipcode that works at a more granular level but is frame aware so will tell you whats happening on a frame by frame basis.

Some links:

Article : Here

Screenshots of it in my game : Here

(Top Right corner shows the results, the GUI is my engine however)

HTH

Chris Brodie
http:\\fourth.flipcode.com


[edited by - gimp on August 16, 2002 9:01:21 AM]

[edited by - gimp on August 16, 2002 9:02:14 AM]

Share this post


Link to post
Share on other sites
What you need is a profiler.

There''s one in Visual C++ (Build - Profile...) but I''ve not used it much so I can''t vouch for it. There''s also a trial version of Intel''s VTune on their site which is very good once you get used to it.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

Share this post


Link to post
Share on other sites
If you have the Professional version of MSVC, then there is built in profiling. Check the MSDN documentation for instructions on its use. Having said that it''s not the most user friendly thing.

Alternatives, most aren''t free, but you can download trial versions:

Intel VTune

NuMega TrueTime

AMD CodeAnalyst (free)

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites