SIGN UP MEMBER LOGIN:    
ARTICLE

Streamlining Web Application Performance

Posted by Praveen K Prasad Articles | Coding Best Practices June 29, 2006
This article discusses some performance tuning tips for those who use ASP.NET as front-end and Microsoft SQL Server as back-end to develop their applications.
Reader Level:

Performance is the prime factor in the development of all type of applications. It becomes extremely important for a web application. Here are some guidelines for improving the application performance.

On the ASp.net Side

  • Viewstate dramatically increase page size so use viewstate for controls carefully.

  • Use static or shared variable instead of application variable.

  • Use AJAX where ever possible.

  • Avoid writing inline code.

  • Use server.tranfer instead of response.redirect whenever possible.

  • Avoid using datagrid. Use repeater and datalist where ever possible.

  • Avoid use of a Throw to control the application flow: As it is an expensive operation, it should be used only when the execution must be stopped.

  • Avoid overuse of exception handling block: Do not place try's in everywhere in the code. Put just in places where you can't have control

  • Avoid huge methods: It is preferably small ones, which do just one single purpose. Huge methods, doing so many things tend to get even bigger, and the code tends to become slower for every maintenance.

  • Datasets are too costly. when using them; try to fetch max data in dataset once and then consume this dataset.
On The MSSQL Side
  • As everyone know, use stored procedure instead of writing long text queries. Stored procedures use compiled execution, are stored permanently on the back-end thus executes dramatically faster than text queries. When your SQL Server is located on another server and accessed over a network, stored procedures can help you to reduce network taffic as simple data elements are passed through the backend rather thang long text queries.

  • Never name your stored procedure with the prefix sp_. This prefix is internal to Microsoft SQL Server for looking for sp's in master db, so when you name your sp with sp_ firstly, the server will look for it in master table.

  • Avoid SELECT * FROM TABLE: This generate an internal select on syscolumns to determine which columns is going to be returned. Instead specify individual column names.

  • If possible, avoid table scans Try to insert at least an index for every table.

Login to add your contents and source code to this article
share this article :
post comment
 

ASP.Net always use Viewstate to retrieve value isn't it. If you disable viewstate how the code behind could retrieve values from rendered HTML controls?

Also for Excel Like Form (Multi Rows Entry) how to optimize that form from viewstate. It could become really really huge.

Posted by Edwin Jul 05, 2006

Stored procedures use compiled execution and executes dramatically faster than text queries.

This statement is wrong t-sql is also compiled check books online it's in there

Posted by gary.thickett Jun 30, 2006
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor