Showing posts with label performance imrovements. Show all posts
Showing posts with label performance imrovements. Show all posts

March 06, 2011

ASP.NET Performance Tip2

Read Tip1 Here

2.  Disable Session State

In ASP.NET Session State  is on by default for every page . So we need to disable Session State if we are not going to use it.  Sessions are created to  pass information from one page to other page per user. We do not require Session State when web pages are static or when there is no need to store information captured in the page.  Do not use sessions to store Global data that is specific to all users. Session is specific to single user.

We can this off for specific pages, as well as entire page depending on the requirement. Usage of sessions will significantly decrease the performance of the application .  So we need to try to minimize the use of  sessions in Web Applications.  If we are not using Sessions in the application it can be set off in the web.config that applies to entire application.

Otherwise it can be disabled in page level as

<%@ Page language="c#" Codebehind="Form.aspx.cs" AutoEventWireup="false" Inherits="WebApplication1.Form" EnableSessionState="false" %>


In web.config  we can turn off sessionstatemode under System.Web Section as follows.

<sessionState mode="off"></sessionState>

As all of us know,ASP.NET Manages session state automatically. But if we do not require Sessions, disabling it will help in boosting the performance of the application.

March 05, 2011

ASP.NET Performance Optimization Tips

I would like to write series of tips for my blog readers on ASP.NET Application performance and what kind of tips we need to follow to improve it .We design and develop web applications. Perfect. Works Fine in Development Server. We will not have huge data as we have in production environment in the development environment.

So everything goes well in development , QA Testing , Staging. But when it moves to production common problem is Performance . Each & Every Web Developer struggle to make their applications scalable.  When multiple users accessing the application simultaneously, or if we have larger data from years that has grown in the database what are the precautions we need to take?  General Question that sucks is What are the best practices to improve the performance of the application.? So Read on.. and stay tuned for daily updates

1. Disable View State if not used

2. Disable Session State if not required

3. Use using keyword to define scope for objects dispose

4. Set Updatepanel  updatemode to conditional