473,379 Members | 1,355 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,379 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 1358
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 ?
1
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: 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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.