Is there a rule for a large number of placeholders that can be placed on a web page?

Using aspx and C # 3.5, vs2008.

Is there a rule for how many placeholders can be placed on a web page before performance starts to degrade?

Any other problems when using a lot of placeholders?

I am dynamically inserting controls (text boxes, checkboxes, expression flyers and buttons into my page.

+2


source to share


3 answers


There is no better answer than trying it for yourself. Use as many placeholders as you need, go to the test / profile code of the page, and then finally optimize them using whatever method works best.

I quote from Mr. Knuth:



Premature optimization is the root of all evil!

+1


source


As long as you are typing them by hand, I would say that you are safe. If you start copying and pasting to get hundreds of place holders, you can get a measurable performance hit. When you hit a few thousand, you can make a noticeable difference.



+1


source


You are talking about a couple of things here: placeholders and all the other web controls that I assume you put in those placeholders.

First of all, the placeholders themselves are a very lightweight control that does not generate additional markup and requires very little ASP.NET processing. So you should be able to put hundreds of them on the page while still pretty fast.

However, the other controls you put inside each placeholder have the potential to generate a significant amount of markup, view, and of course more server side processing.

So there really isn't a standard answer for this, as it really depends on your specific application and your audience. But there are a few things I can share:

1.) Look at the final HTML size. Generally speaking, I prefer to keep my public HTML pages under 100KB each, and my home page up to 20KB whenever possible. Obviously it's not the end of the world to make an HTML page bigger than that (many popular sites do). But a lot of that I would at least think about splitting it into multiple pages. High speed connections may be rife today, but users are just as impatient as they used to be, so get your site up quickly.;)

2.) There is always the question of scalability. To test this, you can check the "Microsoft Web Application Stress Tool" to try to simulate the situation with maximum load. Then take a look at things like cpu, memory, and bandwidth usage to see if this is strong on the server. Again, if it's too heavy load, you might want to consider splitting the page.

+1


source







All Articles