Tuesday, July 21, 2009

ASPNet Optimzation Tips

Use Page.IsPostback to avoid unnecessary processing on a round trip.

CACHE data and page output whenever possible.

Turn OFF ViewState if not being used.
Ihe ViewState is configured at three levels which results in slow performance of the application,when it is Turned ON.

Minimize the amount and complexity of data stored in a session state.
The larger and complex the data is ,the higher the cost of serializing or deserializing of data.

Disable the Session when it is not using.
This can be done at the application level in the
"Machine.Config" file or at a page level.

Use SERVER.TRANSFER rather than Response.Redirect, if the WebPage is present in the same application. This makes the communication faster.

Use Exceptions in the code where necessary.
Exceptions reduce performance. Do not catch the exception itself before handling the condition.

Cache data and page output whenever possible.

Disable DEBUG mode before deploying the application.

Do a “PRE-BATCH" compilation.
To achieve this, request a page from the site. Avoid making changes to pages or assemblies that are there in the bin directory of the application. A changed page will only recompile the page. Any change to the bin directory will result in recompile of the entire application.

Use ASP.NET TRACE feature for efficient debugging instead of RESPONSE.WRITE.

Use Server Controls in appropriate circumstances.
Since ,they are expensive because they are server resources even though are they are very easy to implement.

IN-PROC option will provide better performance.
SQL SERVER option provides more reliability

Release the native resources as soon as the usage is over.
This will reduce performance issues, since by nature GC release them at a later point.
This results in appropriate utilization of resources by the other Requests.

No comments:

Post a Comment