there is no practical way to compare performance, as generally you will will use different patterns to code a site in one vs the other.
both are built on the asp.net fraemwork, and have the same httprequest events. webforms adds page life cycle events. mvc controllers use model binding. in webforms controls lookup their values via a dictionary lookup, mvc model binding is done via reflection.
webforms are more efficent here, but require building the whole control tree. the more controls, the more overhead. but webform databinding also uses refection, so if you use webform databinding, then you lose its performance edge.
currently razor views are slower than webforms views, but i'd still use razor.
but look at all the code that is the same, database, entities, business rules, sesison mgt, etc. except for the most trival apps, this is the bottleneck, not the html rendering engine.
I understand the architecture differences and it would seem that MVC has much less overhead than Web Forms.
I also understand that performance will have many factors in addition to .NET such has database and hardware.
However, I was hoping someone had actually implemented a database sample application using both for a side by side comparison, especially for high volume web sites.
Personally, I like Razor and would rather not work on another Web Forms project but it would be nice to have hard data.
, I was hoping someone had actually implemented a database sample application using both for a side by side comparison, especially for high volume web sites.
Many have this idea. However, it is not feasible. Who do you think that can, for high volume web sites, do twice the programming and pay the programmers ?
Of course no one would do this for a business but Microsoft might do it for their own research. It would not have to be a large web site but only one that you could use to generate lots of test transactions.
And they would have to be smart enough to make sure each code is comparably efficient. They might even be able to implement the same business layer and data access layer.
What will be the benefit for Microsoft to do that? There are more studies / researches to do than that ( asp.net versus php, mvc versus ruby on rails ) then programmers... So I think ( and it's normal) Microsoft will do first the most advantages - and
later( if it comes...) the others.
CharlesSmith
They might even be able to implement the same business layer and data access layer.
I realize to put same BL and DAL in MVC and in DOS : see
Actually mvc is an archictere, where as in wbforms are serverside web pages. there is Performance diffenence between aspx engine and razor engine. mostly mvc is used for Larger scope Projects. Compare to Aspx Engine Razor Engine Performance
Is high Because Ther Is no view State in Razor Engine.
CharlesSmith
None
0 Points
15 Posts
performance studies MVC vs Web Forms
Apr 13, 2012 02:02 AM|LINK
Has anyone seen any performance data comparing MVC and Web Forms?
I understand the architecure differences but I have never come across any perfomance numbers.
Thanks
Rion William...
All-Star
27740 Points
4576 Posts
Re: performance studies MVC vs Web Forms
Apr 13, 2012 02:06 AM|LINK
While not exactly performance data, this is a thread on Stack Overflow discussing the same topic:
WebForms vs MVC (discusses performance, ease-of-use, etc.)
Rion William...
All-Star
27740 Points
4576 Posts
Re: performance studies MVC vs Web Forms
Apr 13, 2012 02:07 AM|LINK
Here are a few more (primarily based on performance)
MVC vs Webforms Performance
A Clear Loser Emerging : MVC vs Webforms
Speed and Architecture Comparision : MVC vs Webforms
bruce (sqlwo...
All-Star
36852 Points
5446 Posts
Re: performance studies MVC vs Web Forms
Apr 13, 2012 02:40 AM|LINK
there is no practical way to compare performance, as generally you will will use different patterns to code a site in one vs the other.
both are built on the asp.net fraemwork, and have the same httprequest events. webforms adds page life cycle events. mvc controllers use model binding. in webforms controls lookup their values via a dictionary lookup, mvc model binding is done via reflection. webforms are more efficent here, but require building the whole control tree. the more controls, the more overhead. but webform databinding also uses refection, so if you use webform databinding, then you lose its performance edge.
currently razor views are slower than webforms views, but i'd still use razor.
but look at all the code that is the same, database, entities, business rules, sesison mgt, etc. except for the most trival apps, this is the bottleneck, not the html rendering engine.
CharlesSmith
None
0 Points
15 Posts
Re: performance studies MVC vs Web Forms
Apr 13, 2012 03:10 AM|LINK
Thanks everyone for the answers.
I understand the architecture differences and it would seem that MVC has much less overhead than Web Forms.
I also understand that performance will have many factors in addition to .NET such has database and hardware.
However, I was hoping someone had actually implemented a database sample application using both for a side by side comparison, especially for high volume web sites.
Personally, I like Razor and would rather not work on another Web Forms project but it would be nice to have hard data.
ignatandrei
All-Star
135110 Points
21675 Posts
Moderator
MVP
Re: performance studies MVC vs Web Forms
Apr 13, 2012 03:41 AM|LINK
Many have this idea. However, it is not feasible. Who do you think that can, for high volume web sites, do twice the programming and pay the programmers ?
CharlesSmith
None
0 Points
15 Posts
Re: performance studies MVC vs Web Forms
Apr 13, 2012 03:58 AM|LINK
Of course no one would do this for a business but Microsoft might do it for their own research. It would not have to be a large web site but only one that you could use to generate lots of test transactions.
And they would have to be smart enough to make sure each code is comparably efficient. They might even be able to implement the same business layer and data access layer.
Just a thought.
ignatandrei
All-Star
135110 Points
21675 Posts
Moderator
MVP
Re: performance studies MVC vs Web Forms
Apr 13, 2012 04:08 AM|LINK
What will be the benefit for Microsoft to do that? There are more studies / researches to do than that ( asp.net versus php, mvc versus ruby on rails ) then programmers... So I think ( and it's normal) Microsoft will do first the most advantages - and later( if it comes...) the others.
I realize to put same BL and DAL in MVC and in DOS : see
http://msprogrammer.serviciipeweb.ro/2010/03/29/asp-net-mvc-orm-and-viewmodels/
and
http://msprogrammer.serviciipeweb.ro/2010/07/05/asp-net-mvc-and-dos-re-using-the-viewmodels/
I do not have considered WebForms as a viable comparison. Maybe you will take my example further ? ;-)
CharlesSmith
None
0 Points
15 Posts
Re: performance studies MVC vs Web Forms
Apr 13, 2012 05:20 AM|LINK
This is the only post with numbers that I have found. It is from 2009.
http://forums.asp.net/t/1488120.aspx/1/10
karthik437
Member
27 Points
11 Posts
Re: performance studies MVC vs Web Forms
Apr 13, 2012 07:13 AM|LINK
Actually mvc is an archictere, where as in wbforms are serverside web pages. there is Performance diffenence between aspx engine and razor engine. mostly mvc is used for Larger scope Projects. Compare to Aspx Engine Razor Engine Performance Is high Because Ther Is no view State in Razor Engine.