Is there a performance difference between asp.net

2020-06-09 07:05发布

问题:

This question already has answers here:
Closed 9 years ago.

Possible Duplicate:
ASP.NET MVC Performance

I know there is a learning curve, but what about performance? It seems to me that web forms would be less performant, but I havent tried MVC yet to know for sure. What is everyone else experiencing?

回答1:

This is almost a duplicate question. Here are some similar discussions:

ASP.NET MVC Performance

What are the key differences between ASP.NET webforms and MVC

Biggest advantage to using ASP.Net MVC vs web forms



回答2:

The thing about WebForms is that it's very easy to make a page that performs really bad, because it encourages you to do a lot of simple updates server-side that really should be done client-side. If you're paying attention to your postbacks and ViewState then WebForms isn't so bad. Also, MVC has the potential for better performance because it takes fewer steps during a page load, but realizing that potential can require a lot of discipline by the programmer, just like web forms.



回答3:

This is debatable because both of them have different performance pros and cons, for example ASP.net MVC gives you control over the HTML/JS that gets to the browser, so you can minimize the amount of data on wire to make the whole application weight less, however ASP.net MVC routing have so much dependency on Reflection, which is relatively slower than fetching a file from the disk which Web Forms is doing.