?
Solved

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

Posted on 2006-11-26
5
Medium Priority
?
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 21

Accepted Solution

by:
mastoo earned 1000 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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 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