473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How much time does CPU spend in each method?

Hi,

I'd like to run my WinForms application through a series of tests and
determine where I can optimize my code. Is there an easy way for a brother
to tell which methods were called most frequently, or more importantly,
which methods took the largest fraction of CPU time to execute? This might
help me narrow down my focus a bit.

The only thing I can come up with is to use the DateTime class to
measure the number of "ticks" spent in each method -- but applying this
approach across hundreds of methods is insane. It occurs to me that perhaps
Visual Studio has an automated way of doing this. Any ideas?

You're the man,

Vincent
Jul 21 '05 #1
3 1357
Look up DevPartner Profiler Community Edition:
http://www.compuware.com/products/de...er/default.asp

----
Adam Clauss
"Vincent Vega" <Pu**@Fiction.com> wrote in message
news:tM********************@giganews.com...
Hi,

I'd like to run my WinForms application through a series of tests and
determine where I can optimize my code. Is there an easy way for a brother
to tell which methods were called most frequently, or more importantly,
which methods took the largest fraction of CPU time to execute? This might
help me narrow down my focus a bit.

The only thing I can come up with is to use the DateTime class to
measure the number of "ticks" spent in each method -- but applying this
approach across hundreds of methods is insane. It occurs to me that
perhaps Visual Studio has an automated way of doing this. Any ideas?

You're the man,

Vincent

Jul 21 '05 #2
You may want to consider the "Free" CLR profiler from Microsoft.

http://www.microsoft.com/downloads/d...displaylang=en

The CLR profiler only shows you memory allocations and garbage collections,
but it might prove useful to you.

--
Jorge L. Matos

"Adam Clauss" wrote:
Look up DevPartner Profiler Community Edition:
http://www.compuware.com/products/de...er/default.asp

----
Adam Clauss
"Vincent Vega" <Pu**@Fiction.com> wrote in message
news:tM********************@giganews.com...
Hi,

I'd like to run my WinForms application through a series of tests and
determine where I can optimize my code. Is there an easy way for a brother
to tell which methods were called most frequently, or more importantly,
which methods took the largest fraction of CPU time to execute? This might
help me narrow down my focus a bit.

The only thing I can come up with is to use the DateTime class to
measure the number of "ticks" spent in each method -- but applying this
approach across hundreds of methods is insane. It occurs to me that
perhaps Visual Studio has an automated way of doing this. Any ideas?

You're the man,

Vincent


Jul 21 '05 #3
Just to clarify - that DevPartner one (community edition) is also free.

- Adam
"Jorge L Matos [MCSD.NET]" <matos_jorge_NOSPAM_AT_hotmail.com> wrote in
message news:51**********************************@microsof t.com...
You may want to consider the "Free" CLR profiler from Microsoft.

http://www.microsoft.com/downloads/d...displaylang=en

The CLR profiler only shows you memory allocations and garbage
collections,
but it might prove useful to you.

--
Jorge L. Matos

"Adam Clauss" wrote:
Look up DevPartner Profiler Community Edition:
http://www.compuware.com/products/de...er/default.asp

----
Adam Clauss
"Vincent Vega" <Pu**@Fiction.com> wrote in message
news:tM********************@giganews.com...
> Hi,
>
> I'd like to run my WinForms application through a series of tests
> and
> determine where I can optimize my code. Is there an easy way for a
> brother
> to tell which methods were called most frequently, or more importantly,
> which methods took the largest fraction of CPU time to execute? This
> might
> help me narrow down my focus a bit.
>
> The only thing I can come up with is to use the DateTime class to
> measure the number of "ticks" spent in each method -- but applying this
> approach across hundreds of methods is insane. It occurs to me that
> perhaps Visual Studio has an automated way of doing this. Any ideas?
>
> You're the man,
>
> Vincent
>


Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
10
by: fabio de francesco | last post by:
Hi what do you think of the following? Why are we permitted to do that? And why the C++ Library doesn't stop someone willing to perfom that assignement (*a = 20)? #include <iostream> ...
3
by: for.fun | last post by:
Hi everybody, I am looking for a XML comparison tool (I do not mean a standard char-by-char diff tool but a tool which understand XML syntax) More precisely, I can have serveral XML...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
3
by: Vincent Vega | last post by:
Hi, I'd like to run my WinForms application through a series of tests and determine where I can optimize my code. Is there an easy way for a brother to tell which methods were called most...
5
by: Jeremy | last post by:
I have a core VB service that monitors a database, and based on data in the records will execute code to send email notifications. Problem: I don't want my main program code to halt and wait for...
12
Banfa
by: Banfa | last post by:
I was mildly concerned when I saw else where on the forum on of our experts express the opinion that software design saw not required and their prefered design method of development was to just start...
4
by: dj | last post by:
Hello again, Does anyone know which method in the time module will generate and am or pm ? If none of the method will do this for me. Can I produce the value on my own ? Any suggestions ?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.