Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / January 2006

Tip: Looking for answers? Try searching our database.

CLR hooks for profiling?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Parrish - 28 Jan 2006 08:09 GMT
I am about to endeavor on learning as much as I can about
tracing/profiling in the CLR.. and in my readings so far I have not
found a way to get time based performance metrics without being
intrusive to the codebase.

i.e. on a current winform system I am working with to optimize, I have
used the free .NET profiler to view the CLR garbage collection
lifecycles and call-graphs etc.. but that information didn't seem to
express as much of a high level view of performance as I needed.

So, I wanted to ask opinions on what I did in the end:

I went into the class for a form that had questionable performance, and
for each method in the class I added as the first call "long start =
DateTime.Now.Ticks;" and.. at the end of the method I added "long end =
DateTime.Now.Ticks;", followed by a tracing statement to write out the
difference in ticks so that I could calculate the cost for the routine.

Using reflection I grabbed the methodname from the currently executing
method. Using the tracing log I created from these statements, I was
able to import the data into a SQL table and generate cost charts,
conversions to seconds, etc.

The one major downside to this is that it requires modification of the
code base with the above statements. I am wondering, are there any sort
of events relating to the CLR that would notify you of entry to a method
and exiting of the method? If that were the case I could write a
seperate perf project for the purposes of tracing the code.

One major problem with the method I am using is the possible case of
multiple returns within the control flow. I then have to carefully read
the code and place the statements at each possible exit point.

Appreciate any input.

JP
Naveen - 28 Jan 2006 16:27 GMT
There are profiling API's. It is unmanaged and not part of the
framework. You can read more about this here.
http://blogs.msdn.com/davbr/default.aspx

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.