Solved

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

Posted on 2006-11-26
5
148 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now