How to increase the performance of asp.net project ?


Here are some important tips to increase the performance of asp.net project

1. Always use database stored procedure rather than sql query.

2. Minimize session variable.

3. Use datatable instead of DataSet.

4. if you bind your control on load event always call dataReader.

5. Always close/dispose or “Using” keyword to your connection/command object.

6. Make “False ” view state of your heavy control like gridveiw or other.

7. Always use caching for your master data like country ddl, state dll and other master data.

8. use  HTTP compression for your full application it will increase 50% speed.

9. Use Div rather than table/td

10. Use WCF instead of WebService.

11. Make <compilation debug=”False”>  in web confi file at uploading on server.

12. Disable Session State if you’re not going to use it.  By default it’s on.

<%@ Page language=”c#” Codebehind=”WebForm1.aspx.cs”
AutoEventWireup=”false” Inherits=”WebApplication1.WebForm1″
EnableSessionState=”false” %>

13. Turn Off ViewState if you are not using

14. Avoid throwing exceptions, and handling useless exceptions.

15. Turn off Tracing at uploading on server.

16 Always check Page.IsValid when using Validator Controls

17.Repeater Control performance is Good  as compare to DataList, DataGrid, and DataView

18. Use “Connection Pooling” concept,if more user are accessing the site at one time.

19. Use external Javascript file.Inline JavaScript could make the HTML page heavy, so it’s preferred to keep separate .js files or a single JavaScript file to keep all JavaScript-based scripts in a single place.

20. Use external Css file rather then Inline css file.

21. Code optimization:  Avoid using code like x = x +1; it is always better to use x+=1.

22. Use buffer or Cache concept of asp.net like this post.
Caching in asp.net

23. Try to use Jquery instead of Ajax Control.Jquery is much more lightweight, easy to use and relatively faster than other commonly used libraries. Using jQuery, it is possible to develop concise scripts as compared to other libraries.

24.Use the custom paging in Gridview using strore procedure or LINQ to avoid the server overload.
25.Try to minimize the database hit using cache concept.
26. Compress the CSS and JavaScript file using compression tool which will reduce the loading time.

Advertisements

4 Responses to “How to increase the performance of asp.net project ?”

  1. google Says:

    I liked your article is an interesting technology
    thanks to google I found you

    • Chandra Dev Says:

      Thank you. You are always welcome.

  2. http://www.moshavercard.com/author/NiklasKin Says:

    Good web site! I really love how it is simple on my eyes
    and the data are well written.

    I am wondering how I could be notified when a new post has been made.
    I have subscribed

    to your RSS which must do the trick! Have a nice day!

    • Chandra Dev Says:

      Thanks. I will keep on posting useful information related with MS technology.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: