473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to optimize Code

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.
Nov 17 '05 #1
3 2591
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

"Gaffar" <Ga****@nannacomputers.com> wrote in message
news:eK**************@TK2MSFTNGP14.phx.gbl...
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.
Nov 17 '05 #2

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
"Gaffar" <Ga****@nannacomputers.com> wrote in message
news:eK**************@TK2MSFTNGP14.phx.gbl...
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.
Nov 17 '05 #3
Hi,

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

http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Regards - Octavio
"Gaffar" <Ga****@nannacomputers.com> escribió en el mensaje news:eK**************@TK2MSFTNGP14.phx.gbl...
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.
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andreas Falck | last post by:
Hi, I ran the code below on two different versions, 4.0.14 and 4.0.16 respectively, both running RH 7.3 on intel. In version mysql server version 4.0.14 the SELECT privelege suffices for...
0
by: Daniel | last post by:
Hi there, I recently came across an interesting option when right clicking on a project (Right click on the project -> properties -> Configuration Properties ->Build -> Optimize) There is an...
6
by: Silly | last post by:
byte Name = new byte; uint len = (uint)Name.Length; uint err = MyFunction(devID, out Name, out len); When this code is run in release build with optimize code set to true, len is evaluated to...
15
by: kenneth | last post by:
I was trying to use multiple thread to optimize my following code, but met some problems, anyone can help me? k are initialized. int computePot() { int i, j; for( i=0; i<500; i++ ) { for(...
14
by: andreyvul | last post by:
I have this loop (all variables are pointers): for (foo = bar; foo baz; foo--) *(foo+1) = *foo; How do I optimize the pointer swap so that it uses -- and ++ or unary +- instead of +1 (if possible...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.