Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Anecdotally, I've visited many .aspx website that require a significant amount of load time for each page.

Is my experience unique?

If not, why might an ASP.Net website load slowly?

share|improve this question

closed as too broad by amon, MichaelT, Bart van Ingen Schenau, Dan Pichelman, GlenH7 Dec 19 '14 at 20:08

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Could be many factors at play. The site you're using this very moment is built on .NET, and it typically is very fast (minus downtimes/maintenance periods). The developers of those sites might be pushing tons of data to you, or slow connections, or overloaded servers, etc. etc. etc. It could also be perception at play. – birryree Mar 2 '11 at 22:53
@birryree You should add your comment as an answer, since you pretty much hit the nail on the head there. – Adam Lear Mar 2 '11 at 22:58
up vote 18 down vote accepted

Five possibilities I can think of (aside from some advanced caching techniques and such):

share|improve this answer
+1. JIT on the first visit is quite noticiable. – Jon Onstott Mar 2 '11 at 23:20
You can't site one example? – JeffO Mar 3 '11 at 1:07
ViewState also plays a part in these problems as well. – Erin Mar 3 '11 at 2:47
1) In other words, ASP.NET uses more resources than asp classic? – HK1 Mar 3 '11 at 3:40
I think another common problem not mentioned in your great answer (or any of the other answers here) is slow database access. I've used several "budget" web hosting companies (network solutions, not to mention any names) and have had some pretty bad slow downs due to database access (SQL Server). – HK1 Mar 3 '11 at 3:45

As apparently this might be answer worthy.

Could be many factors at play. The site you're using this very moment is built on .NET, and it typically is very fast (minus downtimes/maintenance periods).

The developers of those sites you go to might be pushing tons of data to you, or slow connections, or overloaded servers, etc. etc. etc. It could also be perception at play. Also, maybe insane javascript at play and you're running IE? Or flash?

share|improve this answer

If you don't really know what you are doing, ASP.NET WebForms allows you to create a web application by dropping controls onto a form, even going as far as hiding the stateless nature of http. It works, but that sort of development is never going to produce efficient code, especially if your data access layer involves generated queries selecting everything from a sql express database with no indexes.

There are plenty of fast websites out there, developed by people who understand how web applications really work. That includes this site - it uses ASP.NET MVC which provides a lot more control over handling of individual requests and doesn't show the .aspx extension.

share|improve this answer

Just speculation here as I've noticed the same thing. I suspect that .asp sites tend (notice the word tend) to be self hosted on a company's servers, as opposed to hosted at or in data centers. So they're often run on hardware and connections not really designed for high speed web traffic. I suspect cold fusion driven sites also suffer from this.

share|improve this answer

When a website loads (application.start event), it takes time to load everything into memory. Depending on the IIS settings, after about 20-30 minutes of inactivity, it will unload. I've not come across a decent way to keep the application running constantly without having some service doing a GET every 10+ minutes.

A poorly designed backend/datalayer can make anything run slow (no matter how fast the computer running it). Profiling will help you identify where the problems are.

share|improve this answer

You are most certainly imagining this. :)

A lot of factors come into play with any software. The architecture, the redundancy of the code flow, the quality of the code, etc. Too many to even begin listing.

Do you want proof that ASP is good for enterprise level usage? This very site (and all of the SE) websites are made using ASP.Net - specifically MVC.

When was the last time this site was slow? I've been here for over a year and never once have I noticed things chugging along despite its massive userbase.

share|improve this answer

The viewstate can really slow down the postbacks. If you have sever large drop down lists on a page you should not use the view state on them.

The viewstate lets you pretend you're working on a stateful winforms app. That can get you into trouble sometimes.

share|improve this answer

All of the above are likely true. The biggest single factor affecting the performance in the ASP.NET site that I worked on though was that everything relating to it was old. The .NET framework version, the servers, the database infrastructure, and the code itself were all aging badly.

I suspect many ASP.NET sites tend to be corporate sites. These don't get a lot of love, since they tend to just work. People don't rewrite them until they have to, which is often a very long time down the road.

I know the site that I worked with that used ASP.NET got a huge speedup just by moving to the newest version of the framework, which had much more efficient JITing and sane caching defaults.

The other thing that I've seen that a lot of ASP.NET sites do not know how to scale properly. They don't have proper load balancing set up because designing their site to work correctly with web gardens is not common or well-documented in the community. If you don't design your site for web gardens from the beginning, you can't use the built-in scale-out mechanism that IIS has. Software load balancing with Windows NLB is not very common and is complex to manage. (This harkens back to the fact that ASP.NET tends to be corporate software, and tends to be managed by the company running the site rather than IT professionals who know how to configure this stuff correctly.)

Hardware load balancing with F5s is very very expensive, but seems to be the most common and simple mechanism for scaling out ASP.NET sites within corporate networks. I think among the open source crowd the expectation is that you build in load balancing from the beginning using freely available open source tools that automatically scale out based on usage. This is not common in the ASP.NET world from what I've seen.

share|improve this answer

protected by gnat Dec 7 '14 at 16:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.