How Can I Improve performance of ASP.NET Application

by iatanasov 26. July 2007 09:44

 

Step1: Learn "Hot to work with strings?"

If you are c++ programmer and start with modern languages while Delphi, c# or Java, there have thausands of lines writen for working with strings.

Never not use:

    string result = ""; //instead result = string.Empty.

For this method of initialization of string variable Microsoft are make couple of optimization.

If you want to format same string, don't write:

    result = var1 + " this is " + var2 + " the best " var3 + " ."; //where var 1-3 are string variable

Just use:

    result = String.Format("{0} this is {1} the best {2} ."

If you must concatenated  more that four string, in language exist StringBuilder. I'm make test with 1000 concatanations of strin. For "result += result" this take about twenty 

seconds, instead for StringBuilder is three seconds. 

If you campare strings, don't use equals operator (this is stupid  least). Use String.Compar() or string result = "test", result.Equals("tests")

Step2: Use "Using" block for working with database and file system.

if you open file or database connection just write:

        using(SqlConnection connection = new SqlConnection(connectionString))
        {
             connection.Open()
        } //after programs pass this line, connection is closed

What deliver this functionallity for you?

  1. if you forgot to close connection, it's closed.
  2. couple of lines code, that you have to write. 

Step4: Use generics  List instead ArrayList. 

ArrayList object make boxing and unboxing in every operation with it, for this reason Microsoft ® release List<T> (generic lists) with .net 2.0. When they are make optimization , we just have to use it.

Never don't write:

    ArrayList customers = new ArrayList();  // List<Customer> customer = new List<Customer>();

    customers.add(new Customer());         // it's same

    Customer temp = customers[i] as Customer; //  Customer temp = customers[i];//without unboxing;

Step5: Don't use ssl on every pages

I'm look person that write e-commerce application and they put ssl on every web pages. This isn't right decision, you must implement you chec-out process with ASP.NET wizard

and put user iteration only on couple of pages. When user browse web site , there no reason to have SSL on every page. If you open sites while amazon i yahoo shopping you will

see,  that use ssl when you buy product and must enter same sensitive information.

For you stay problem to define which pages exatly have need to be put on SSL line, this one will be perfect fix the problem with your ASP.NET perfomance.

Conclusion:

  • Working with string is imporatnt for web development.
  • Minimazing using of ArrayList, instead use Custom Obgects with Generic List.
  • Minimazing using of SSL, this will put down your web server. 

 

Currently rated 4.0 by 3 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

asp.net 2.0 | web development

Related posts

Comments

October 20. 2009 21:35

Gravatar

I always wanted to write in my site something like that but I guess you'r faster :)

fast cash loans us

January 28. 2010 14:45

Gravatar

To succeed... You need to find something to hold on to, something to motivate you, something to inspire you

Loans in TN us

January 29. 2010 11:08

Gravatar

How Can I Improve performance of ASP.NET Application. I enjoyed reading it.Really interesting articles. I need to read more on this topic..Thanks for sharing a nice info....

Hair Color Pictures us

February 4. 2010 09:51

Gravatar

You always pass failure on the way to success.

online payday advance us

February 12. 2010 12:57

Gravatar

How Can I Improve performance of ASP.NET Application. I enjoyed reading it.Really interesting articles. I need to read more on this topic..Thanks for sharing a nice info....

herpes photos us

February 13. 2010 03:59

Gravatar

How Can I Improve performance of ASP.NET Application. Thank you for another great article. Where else could anyone get that kind of information in such a perfect way of writing? I have a presentation next week, and I am on the look for such information..

practice us

February 27. 2010 08:16

Gravatar

I was looking for this the other day. i dont usually post in forums but i wanted to say thank you!

cash advance

February 28. 2010 12:11

Gravatar

I am not really sure if best practices have emerged around things like that, but I am sure that your great job is clearly identified. I was wondering if you offer any subscription to your RSS feeds as I would be very interested and can?t find any link to subscribe here.

Acne products

March 1. 2010 13:20

Gravatar

I can see that you are putting a lot of time and effort into your blog and detailed articles! I am deeply in love with every single piece of information you post here (there are not many quality blogs left:).By,the way if you are looking for link exchange with quality job borad in UK,please drop an email-I will be glad to add your link.

Regards,
Chris

jobs uk

March 3. 2010 23:50

Gravatar

Hey, i've been reading this blog for a while and have a question, maybe you can help... it's how do i add your feed to my rss reader as i want to follow you. Thanks.

Herbal colon cleanse

March 4. 2010 13:48

Gravatar

Hey very nice blog!! Man .. Beautiful .. Amazing .. I will bookmark your blog and take the feeds also... Big thanks for the useful info i found on How Can I Improve performance of ASP.NET Application.

no credit check loans

March 7. 2010 04:05

Gravatar

Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful. Big thanks for the useful info i found on How Can I Improve performance of ASP.NET Application.

payday loans

March 7. 2010 15:00

Gravatar

How Can I Improve performance of ASP.NET Application. Thanks for such a nice article.It includes very informative information about the article..

physical therapy us

March 8. 2010 20:52

Gravatar

I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post. Big thanks for the useful info i found on How Can I Improve performance of ASP.NET Application.

payday cash loans

March 13. 2010 16:24

Gravatar

I just hope to have understood this the way it was meant

Stretch mark removal

March 26. 2010 11:41

Gravatar

This is my very first time here , really good looking blog http://www.hotyear.com. I found a lot of interesting stuff within your blog especially it's discussion. From all the remarks on your articles, it appears like this is a very http://www.s101.net popular website. Keep up the good work.

Olympia Levanger cn

March 26. 2010 12:01

Gravatar

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful and beneficial to your readers.

Isaias Falk cn

March 26. 2010 13:06

Gravatar

The tragedy of life is not http://opensourcecinema.org/user/65269 that it ends so soon, http://depressionselfhelp.mynewblog.com/i-like-my-drinking-water-filter/ but that we wait so long to begin it.

Lou Cannone cn

March 26. 2010 23:34

Gravatar

Hello. Great job. I did not expect this on a Wednesday. This is a good story. Big thanks for the useful info i found on How Can I Improve performance of ASP.NET Application.

how to get rid of toenail fungus

March 27. 2010 01:21

Gravatar

Couldnt be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!

same day payday loan

March 28. 2010 03:00

Gravatar

I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful

quick loan approval

March 29. 2010 17:04

Gravatar

Thanks for all the enthusiasm http://www.ziitrend.com/user/richard56 to offer such helpful http://changemylife.mynewblog.com/the-dumbest-dumb-drinking-water-fitler/ information.

Christine Himmelspach cn

March 30. 2010 10:50

Gravatar

Have you ever considered adding more videos to your blog posts to keep the readers more entertained? I mean I just read through the entire article of yours and it was quite good but since I'm more of a visual learner,I found that to be more helpful well let me know how it turns out! Big thanks for the useful info i found on How Can I Improve performance of ASP.NET Application.

cure for genital warts

March 30. 2010 20:06

Gravatar

Your blog provided us with valuable http://www.codeplex.com/site/users/view/richard56 information to help us get http://www.bigoven.com/~richard56 started.You have done an impressive http://www.naymz.com/richard_richard_3262174 job!

Carmen Bierly cn

April 1. 2010 15:31

Gravatar

That is some inspirational stuff. Never knew that opinions could be this varied. Thanks for all the enthusiasm to offer such helpful information here.

used car loan

April 2. 2010 22:06

Gravatar

The tragedy of life http://yedda.com/people/186730211711524/ is not that it ends so soon, but that we wait so long to begin http://depressionselfhelp.edublogs.org/this-drinking-water-filter-is-total-bs/ it.

Ezekiel Eichenberg cn

April 4. 2010 17:30

Gravatar

As a Newbie, I am always searching online for articles that can help me. Thank you

help with credit card debt

April 5. 2010 07:20

Gravatar

I don’t usually reply to posts but I will in this case. WoW :) Big thanks for the useful info i found on How Can I Improve performance of ASP.NET Application.

cellulite home remedies us

April 5. 2010 23:07

Gravatar

I have recently started using the blogengine.net and I having some problems here? in your blog you stated that we need to enable write permissions on the App_Data folder...unfortunately I don't understand how to enable it.

easy egg recipes cn

April 6. 2010 11:14

Gravatar

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.

cuisinart ice cream recipes cn

April 8. 2010 05:53

Gravatar

Thank you for another great article. Where else could anyone get that kind of information in such a perfect way of writing? I have a presentation next week, and I am on the look for such information.

drinking water filter system us

April 8. 2010 17:07

Gravatar

You can never plan the future by the past.

KY Payday Loans us

April 8. 2010 17:08

Gravatar

A creative man is motivated by the desire to achieve, not by the desire to beat others.

MA Payday Loans us

April 9. 2010 21:51

Gravatar

Thanks for that opinion.
Makes me want to get more info on asp.net. site optimization

Chris hk

April 13. 2010 02:06

Gravatar

Thank you for starting this excellent thread. I've been looking info like this.
Peace

Ryan pk

April 14. 2010 07:38

Gravatar

I love reading your blog.
There's some great information here on asp.net. site optimization. Peace.

Susan mc

April 16. 2010 05:17

Gravatar

Thank you for your post, and i suppose it helps me a lot.

essay examples

April 20. 2010 20:39

Gravatar

c

water heater cn

April 23. 2010 14:14

Gravatar

I've been looking a good website on asp.net. site optimization and related stuff. Thanks for putting this up.
Peace

Stephen no

April 24. 2010 21:56

Gravatar

c

infant bath seat us

May 2. 2010 18:52

Gravatar

Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful.

emergency cash loan us

May 4. 2010 21:04

Gravatar

I was just talking to my friend about this very subject.
You must be psychic or something!

city grosse pointe farms dz

May 6. 2010 08:18

Gravatar

I generally don�t post in Blogs but your blog forced me to,
amazing work.. beautiful �

jose tomas tn

May 8. 2010 21:36

Gravatar

I was looking for this the other day. i dont usually post in forums but i wanted to say thank you!

payday loans us

May 9. 2010 04:07

Gravatar

There are certainly a lot of details like that to take into consideration.

Ricky gl

May 14. 2010 08:34

Gravatar

You made some great factors there.
I did a search on the topic and discovered numerous people will agree together with your weblog.

Earl Cochran is

Comments are closed

Powered by BlogEngine.NET 1.1.0.7
Theme by Mads Kristensen

About the author

Ivan Atanasov - web developer
E-mail me Send mail Subscribe Feed

Calendar

<<  May 2012  >>
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar

Pages

    Recent posts

    Recent comments

    Authors

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2012 it-coder.com

    Sign in