Solved

Anybody got any ideas about how to improve my program's performance

Posted on 2006-11-26
5
149 Views
Last Modified: 2010-04-16
Hi,

I need to find the bottlenecks in my program so I can re-write them.  Anybody got any suggestions how to find them?

Are there any programs you could suggest that could profile the way my program runs?  And which functions get most of the clock cycles?

Is there a built in tool in VS2003?

Also, what about calling Destroy()?

When I came from C++ I was told you don't need to clean up after yourself, the environment does that for you.  But lately I've hear dthat's not true.  Meanwhile I have done nothing to override Destroy() and remove my objects.

What re some basic rules I can use to start going through my numerous objects and dialogs to start implementing Destroy()?

When a dialog cals its destroy, should I be destroying the controls I created in that dialog?  What function do I call?  Do I set it to null as well?

Thanks for any help you provide.  I'm in a pickle and can't get out of it.

Bob
0
Comment
Question by:ba272
5 Comments
 
LVL 21

Accepted Solution

by:
mastoo earned 250 total points
ID: 18016965
You'll save yourself much time by not guessing.  Get a profiler like red-gate.com ants profiler and it will show you exactly where your program spends its time.
0
 
LVL 7

Assisted Solution

by:mjmarlow
mjmarlow earned 250 total points
ID: 18017112
In C# you do not destruct objects.  The garbage collector does that for you.   (You mentioned hearing that this is not true - can you provide more information about this?)  There is a standard pattern in C# that says if you design an object that contains unmanaged resources then implement IDisposable.  Consumers of a class that implements IDisposable should call its Dispose method when finished with it.   The reason is the CLR garbage collector only works with managed objects.  So if your application creates a COM object or uses a C++ DLL you still need to handle destruction of resources those may utilize.

I agree with mastoo, Ants is worth a look.  If i recall, they have a free trial version too.  Alternatively you can instrument your code with Log4Net (open source).

0
 

Expert Comment

by:newbieweb
ID: 18017127
Well I have heard caims that I still need to destroy objects in certain case, using C#.  Not long ago I made a dialog with a timer.  And when the timer fired, a function executed.  but when I closed th edialog, it still executed.  That's one example of when I needed to explicity set it to null in the destroy function of the dialog.

0
 

Author Comment

by:ba272
ID: 18017132
no that was me from my other account...  Sorry.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question