Is there a performance difference between asp.net

2020-06-09 06:37发布

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?

3条回答
够拽才男人
2楼-- · 2020-06-09 07:19

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.

查看更多
放我归山
3楼-- · 2020-06-09 07:28

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.

查看更多
登录 后发表回答