views:

74

answers:

3

Is it true that asp.net MVC doesn't use SESSIONS [Sessions varibale] and hence there it's performance is better than asp.net webform. if this is not the case then why the speed of asp.net MVC is faster than asp.net webform?

+4  A: 

No, it is not true. ASP.NET MVC builds on the top of ASP.NET so you have the same storage options like Application, Session, Cache, ... It is up to the developer to decide whether he wants to use session or not. So if you use Session inside your ASP.NET MVC application the performance would be the same if you were using Session in a classic WebForms application.

Darin Dimitrov
+5  A: 

It's actually does not use VIEWSTATE,since viewstate data doesn't transmit to and fro between client and server,the MVC pages load a bit faster.

Srinivas Reddy Thatiparthy
what does viewstate have to do with session?
RPM1984
@RPM well, i answered performance part.I am not sure about the session.
Srinivas Reddy Thatiparthy
+1 Thanks for this information.
Zerotoinfinite
+1  A: 

ASP.NET MVC does use Session whenever you use TempData. However, Session isn't inherently poor on performance. Where you get issues are when scaling out across more than one machine which means you need to take this into account when defining your architecture. If you do choose to use session never reference it directly from your controllers. Always provide an abstraction to allow for different implementations for scalability.

With regards to performance in comparison with WebForms I believe the developer is capable of writing scalable websites with either platform. However, they are also capable of writing poorly performing websites with both also. Srinivas is correct that MVC doesn't use VIEWSTATE and therefore the download footprint of your pages is smaller.

For me the main benefit of MVC is the support for unit testing. You also get far greater control of the markup, if this is something you require. But performance isn't something you really need consider when deciding between WebForms or MVC.

Daz Lewis