Solved

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

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

19 Experts available now in Live!

Get 1:1 Help Now