How to optimize Code

  • Thread starter Thread starter Gaffar
  • Start date Start date
G

Gaffar

Hello,

I am Handling a project in ( ASP.NET with C#.NET) in which a module is slow and inefficient. How to optimize the code. Please give me some suggestions regarding this.
If you know any code optimization links please Help me.

Thanx in advance.

Regards
Gaffar.
 
At first it is necessary to determine what is the cause of performance
problem. The most common is algorithm inefficiency. You can have loops with
great amount of memory allocations, or arrays search etc.

The optimization strategy depends on the problem found. E.g. if there is a
great number of allocations you'll try to reduce them, using some temporary
storage, if there is great number of array searches - try to use hashtables
and so on.

To localize the problem in the code you can use profiling tools in order to
determine what part of that module can cause performance problems. You can
use Devpartner profiler or CLR profiler (they are free ) to determine this.

--
Vadym Stetsyak aka Vadmyst

Hello,

I am Handling a project in ( ASP.NET with C#.NET) in which a module is slow
and inefficient. How to optimize the code. Please give me some suggestions
regarding this.
If you know any code optimization links please Help me.

Thanx in advance.

Regards
Gaffar.
 
Hi there

Use a profiler to specify where your speed problem is.
Often it is somewhere where you did not expect it to be.

--
Best regards C.T.O. Søren Reinke
www.Xray-Mag.com/ - Your free diving magazin on the net. Download it in PDF
Aug-sept issue of X-RAY Magazine is ready to download:
EGYPT Finding Yolanda Wreck, Celebrate the Seas 2005


Hello,

I am Handling a project in ( ASP.NET with C#.NET) in which a module is slow
and inefficient. How to optimize the code. Please give me some suggestions
regarding this.
If you know any code optimization links please Help me.

Thanx in advance.

Regards
Gaffar.
 
Hi,

Rob Howard is writing good articles on the subject for MSDN Magazine, see for instance

http://msdn.microsoft.com/msdnmag/issues/05/01/ASPNETPerformance/default.aspx

Regards - Octavio


"Gaffar" <[email protected]> escribió en el mensaje Hello,

I am Handling a project in ( ASP.NET with C#.NET) in which a module is slow and inefficient. How to optimize the code. Please give me some suggestions regarding this.
If you know any code optimization links please Help me.

Thanx in advance.

Regards
Gaffar.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top