<p>I found some wild remarks that ASP.NET MVC is 30x faster than ASP.NET WebForms. What real performance difference is there, has this been measured and what are the performance benefits.</p>

<p>This is to help me consider moving from ASP.NET WebForms to ASP.NET MVC.</p>

[{'answer_id': 45614, 'author': 'Seb Nilsson', 'author_id': 2429, 'author_profile': 'https://Stackoverflow.com/users/2429', 'pm_score': 3, 'selected': False, 'text': '<p>The only concrete numbers I can find which are from early ASP.NET MVC-development is on this forum-thread:</p>\n\n<p><a href="http://forums.asp.net/p/1231621/2224136.aspx" rel="nofollow noreferrer">http://forums.asp.net/p/1231621/2224136.aspx</a></p>\n\n<p>Rob Connery himself somewhat confirms statement that ScottGu has claimed that ASP.NET MVC can serve 8000 requests per second.</p>\n\n<p>Maybe Jeff and his crew can give some kind of hint from their development of this site.</p>\n'}, {'answer_id': 46200, 'author': 'Haacked', 'author_id': 598, 'author_profile': 'https://Stackoverflow.com/users/598', 'pm_score': 7, 'selected': True, 'text': "<p>We haven't performed the type of scalability and perf tests necessary to come up with any conclusions. I think ScottGu may have been discussing potential perf targets. As we move towards Beta and RTM, we will internally be doing more perf testing. However, I'm not sure what our policy is on publishing results of perf tests.</p>\n\n<p>In any case, any such tests really need to consider real world applications...</p>\n"}, {'answer_id': 46221, 'author': 'DevelopingChris', 'author_id': 1220, 'author_profile': 'https://Stackoverflow.com/users/1220', 'pm_score': 5, 'selected': False, 'text': '<p>It decreased one of my pages from 2MB payload, to 200k, just by eliminating the viewstate and making it bearable programatically to work with the submitted output.</p>\n\n<p>The size alone, even though the processing was the same will create vast improvements in connections per second and speed of the requests.</p>\n'}, {'answer_id': 221987, 'author': 'Gerald', 'author_id': 19404, 'author_profile': 'https://Stackoverflow.com/users/19404', 'pm_score': 2, 'selected': False, 'text': "<p>There's really no way to answer this. MVC uses the Web Forms view engine by default itself, and can be configured to use any number of custom view engines, so if you want a performance comparison you'll have to be more specific.</p>\n"}, {'answer_id': 226037, 'author': 'Hrvoje Hudo', 'author_id': 1407, 'author_profile': 'https://Stackoverflow.com/users/1407', 'pm_score': 4, 'selected': False, 'text': '<p>My testing shows something between 2x and 7x more req/sec on MVC, but it depends how you build your webforms app. With just "hello world" text on it, without any server side control, mvc is around 30-50% faster.</p>\n'}, {'answer_id': 530933, 'author': 'tvanfosson', 'author_id': 12950, 'author_profile': 'https://Stackoverflow.com/users/12950', 'pm_score': 4, 'selected': False, 'text': '<p>For me the real "performance" improvement in MVC is the increase the testable surface of the application.  With WebForms there was a lot of the application that was hard to test.  With MVC the amount of code that becomes testable basically doubles.  Basically all that isn\'t easily testable is the code that generates the layout.  All of your business logic and data access logic -- including the logic that populates the actual data used in the view -- is now amenable to testing.  While I expect it to be more performant as well -- the page life cycle is greatly simplified and more more amenable to web programming -- even if it were the same or a little slower it would be worth switching to from a quality perspective.</p>\n'}, {'answer_id': 530946, 'author': 'Todd', 'author_id': 54305, 'author_profile': 'https://Stackoverflow.com/users/54305', 'pm_score': 6, 'selected': False, 'text': '<p>I think this will be a hard question to definitively answer as so much will depend on <strong>A)</strong> how you implement the WebForms application, and <strong>B)</strong> how you implement the MVC application. In their "raw" forms, MVC is likely faster than WebForms, but years and years of tools and experience have produced a number of techniques for building fast WebForms applications. I\'d be willing to bet that a senior ASP.NET developer could produce a WebForms application that rivals the speed of any MVC application- or at least achieve a negligible difference.</p>\n\n<p>The real difference- <a href="https://stackoverflow.com/a/530933/61654">as @tvanfosson suggested</a>- is in testability and clean SoC. If improving performance is your chief concern, I don\'t think it\'s a great reason to jump ship on WebForms and start re-building in MVC. Not at least until you\'ve tried the available techniques for optimizing WebForms.</p>\n'}, {'answer_id': 530948, 'author': 'Ariel', 'author_id': 24654, 'author_profile': 'https://Stackoverflow.com/users/24654', 'pm_score': 5, 'selected': False, 'text': '<p>I think that many of the people who think that WebForms are inherently slow or resource intensive are placing the blame in the wrong place. 9 times out of 10 when I am brought in to optimize a webforms app there are way too many places where the apps authors misunderstand the purpose of the viewstate. I\'m not saying that the viewstate is perfect or anything, but it is WAY too easy to abuse it, and it is this abuse that is causing the bloated viewstate field.</p>\n\n<p>This article was invalueable in helping me understand many of these abuses. <a href="https://weblogs.asp.net/infinitiesloop/truly-understanding-viewstate" rel="nofollow noreferrer">https://weblogs.asp.net/infinitiesloop/truly-understanding-viewstate</a></p>\n\n<p>In order to make a valid comparison between MVC and WebForms we need to be sure that both apps are using the architectures correctly.</p>\n'}, {'answer_id': 536125, 'author': 'John Leidegren', 'author_id': 58961, 'author_profile': 'https://Stackoverflow.com/users/58961', 'pm_score': 2, 'selected': False, 'text': "<p>I started out work in MVC about a year ago, I was inspired but not impressed.</p>\n\n<p>I loath the view state and see it as the root of all evil in terms of ASP.NET. This is why I just don't use it and to be perfectly honest why would you?</p>\n\n<p>I took basically the ASP.NET MVC Framework concept and built that in my own way. I changed a couple of things though. I built my controller wrapping code, or URL routing code around dynamic recompilation.</p>\n\n<p>Now, I would go as far as to say that ASP.NET MVC applications will be faster based on how you use it. If you completely abandon WebForms you'll be faster becuase the ASP.NET life-cycle and object model is humongous.</p>\n\n<p>When you're writing  you're instantiating an army... no wait, a legion of objects that will participate in the rendering of your view. This is gonna be slower than if you where to express the minimal amount of behavior in the ASPX page itself. (I don't care about view engine abstraction because the support for ASPX pages in Visual Studio is decent, but I've completely dropped WebForms as a concept and basically any ASP.NET framework due to code bloat or not being able to change the things that wire my application).</p>\n\n<p>I've found ways of relying on dynamic recompilation (System.Reflection.Emit) for emitting special purpose objects and code whenever needed. The executing of this code is faster than reflection but initially built through the reflection service. This has given my MVC flavored framework great performance but also very statically typed. I don't use strings and name/value pair collections. Instead my custom compiler services goes in a rewrites a form post to a controller action being passed an reference type. Behind the scene there is a lot of things going on but this code is fast, a lot faster than WebForms or the MVC Framework.</p>\n\n<p>Also, I don't write URLs, I write lambda expressions that get translated into URLs that later tell which controller action to invoke. This isn't particularly fast but it beats having broken URLs. It's like if you had statically typed resources as well as statically typed objects. A statically typed web application? That is what I want!</p>\n\n<p>I would encourage more people to try this out.</p>\n"}, {'answer_id': 537433, 'author': 'Kibbee', 'author_id': 1862, 'author_profile': 'https://Stackoverflow.com/users/1862', 'pm_score': 3, 'selected': False, 'text': "<p>I think the problem here is that no matter how much faster ASP.Net MVC is than the old webforms, it won't make a difference, because most of the time taken is in the database.  Most of the time, you web servers will be sitting at 0-10% CPU usage just waiting on your database server.  Unless you get an extremely large number of hits on your website, and your database is extremely fast, you probably won't notice a big difference.</p>\n"}, {'answer_id': 12889062, 'author': 'jihe.wei', 'author_id': 1728333, 'author_profile': 'https://Stackoverflow.com/users/1728333', 'pm_score': 2, 'selected': False, 'text': '<p>The projects created with visual studio. One is mvc4 template, another is WebForm (tranditional).\nAnd when make load test with WCAT, this is the result,</p>\n\n<h1>MVC4 is quite slow than WebForms, any ideas?</h1>\n\n<p><img src="https://i.stack.imgur.com/hdxjz.jpg" alt="enter image description here"></p>\n\n<h1>MVC4</h1>\n\n<ul>\n<li>could get about 11 rps</li>\n<li>rps is quite low both 2-cpu or 4-cpu server</li>\n</ul>\n\n<p><img src="https://i.stack.imgur.com/XY0yr.jpg" alt="enter image description here"></p>\n\n<h1>WebForms (aspx)</h1>\n\n<ul>\n<li><p>could get above 2500 rps </p></li>\n<li><p>the performance killer has been found that it\'s a bug of MVC Bata or RC. \nAnd The performance would be improved once i remove Bundles things. Now the latest version fixed this.</p></li>\n</ul>\n'}, {'answer_id': 15415100, 'author': 'Jeff Lequeux', 'author_id': 2140973, 'author_profile': 'https://Stackoverflow.com/users/2140973', 'pm_score': 1, 'selected': False, 'text': '<p>Performance depends on what you are doing... Usually MVC is faster than asp.net mostly because Viewstate is absent and because MVC works more with Callback than Postback by default.</p>\n\n<p>If you optimize your webform page you can have the same performance as MVC but it will be a lot of work. </p>\n\n<p>Also, their is a lot of nugets for MVC (and also for Webform) to help you to improve website performance like combine and minify your css and javascripts, group your images and use them as a sprite, and so on.</p>\n\n<p>Website\'s performance depend greatly of your architecture. A clean one with good separation of concern will bring you a more clean code and a better idea of how improve performance.</p>\n\n<p>You can take a look at this template "<a href="http://visualstudiogallery.msdn.microsoft.com/3702cff6-d04e-4aca-bcd8-01d0822de9f7" rel="nofollow">Neos-SDI MVC Template</a>" which will create for you a clean architecture with lots of performance improvements by default (check <a href="http://www.MvcTemplate.com" rel="nofollow">MvcTemplate</a> website).</p>\n'}, {'answer_id': 20253243, 'author': 'Chris Marisic', 'author_id': 37055, 'author_profile': 'https://Stackoverflow.com/users/37055', 'pm_score': 2, 'selected': False, 'text': '<p>Contrary to the accepted opinion, optimized webforms usage completely kills MVC in terms of raw performance. Webforms has been hyper-optimized for the task of serving html far longer than MVC has.</p>\n\n<p>Metrics are available on <a href="http://www.techempower.com/benchmarks/#section=data-r7&amp;hw=i7&amp;test=db" rel="nofollow">http://www.techempower.com/benchmarks/#section=data-r7&amp;hw=i7&amp;test=db</a></p>\n\n<p>Every single comparison mvc is on the lower-middle/lower-upper rankings of the list, while optimized webforms usage places in the upper-middle/upper-lower rankings.</p>\n\n<p>Anecdotal but very serious validation to these metrics, <a href="http://www.microsoft.com" rel="nofollow">www.microsoft.com</a> is served by webforms not MVC. Does anyone here believe that they wouldn\'t have chosen MVC if it was empirically faster? </p>\n'}, {'answer_id': 27926096, 'author': 'Shivprasad Koirala', 'author_id': 993672, 'author_profile': 'https://Stackoverflow.com/users/993672', 'pm_score': -1, 'selected': False, 'text': '<p><img src="https://i.stack.imgur.com/I7eXy.png" alt="enter image description here"></p>\n\n<p>I did a small VSTS load test experiment with some basic code and found ASP.NET MVC response time to be twice faster as compared to ASP.NET Webforms. Above is the attached graph with the plot.  </p>\n\n<p>You can read this load test experiment in details from this CP article <a href="https://www.codeproject.com/Articles/864950/ASP-NET-MVC-vs-ASP-NET-WebForm-performance-compari" rel="nofollow noreferrer">https://www.codeproject.com/Articles/864950/ASP-NET-MVC-vs-ASP-NET-WebForm-performance-compari</a></p>\n\n<p>Test was conducted with the below specifications using VSTS and telerik load test software:-</p>\n\n<p>User load 25 users.</p>\n\n<p>Run duration of test was 10 minutes.</p>\n\n<p>Machine config DELL 8 GB Ram, Core i3</p>\n\n<p>Project was hosted in IIS 8.</p>\n\n<p>Project was created using MVC 5.</p>\n\n<p>Network LAN connection was assumed. So this test does not account for network lag for now.</p>\n\n<p>Browser in the test selected Chrome and Internet explorer.</p>\n\n<p>Multiple reading where taken during the test to average unknown events. 7 readings where taken and all readings are published in this article as reading 1 , 2 and so on.</p>\n'}]
['https://Stackoverflow.com/questions/43743', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/383/']