CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2001
    Posts
    75

    Speed and memory: Hot to Measures?

    Hi all,

    I have a function. How do I measure:
    1) how fast that function works on my processor
    2) how much memory it uses.

    Thanks




  2. #2
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: Speed and memory: Hot to Measures?

    In Visual C++ you can do a profile on how much time your program spends in each function. This can be done in release mode as well as debug, and you'll normally want to do it in this mode, as that is how it will be running in real life.

    You get two figures - one for how much time it spent in the function itself, and another one accumulating any functions it called, so for that one main() is always the highest. You also get a list of the number of times each function was run.

    Note: if Profile is greyed on your version of Visual C++ (it's in the Build menu) it probably means you didn't install that option. It doesn't come with the "standard" install.




    The best things come to those who rate

  3. #3
    Join Date
    Feb 2002
    Posts
    81

    Re: Speed and memory: Hot to Measures?

    There is a very powerful application in Rational Suite, called Rational Quantify, which measuresa lot of things (function call number, call graphs, call times, thread execution times, etc.). The setup installs an add-in for Visual Studio 6. It is better that the integrated profiler, but it costs a lot.

    To check the memory, you can use the task manager (if under NT, 2000, XP). The utility ProcessViewer, available in Visual Studio Suite can be helpful by providing a lot of data about your process.


  4. #4
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: Speed and memory: Hot to Measures?

    I should add that I think the profiler also calculates memory use if you want it to.


    The best things come to those who rate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured