Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-11-26
5
Medium Priority
?
159 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

610 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