Click here to Skip to main content
15,867,686 members
Articles / Web Development / ASP.NET

ASP.NET MVC vs ASP.NET WebForm Performance Comparison

,
Rate me:
Please Sign up or sign in to vote.
4.77/5 (61 votes)
19 Jan 2015CPOL20 min read 257.1K   82   77
Comparing performance of ASP.NET WebForms and ASP.NET MVC
The intention of this article is to compare performance between ASP.NET WebForms and ASP.NET MVC. The main reasons for moving from Webforms to MVC is performance, performance and performance.

Contents

Intention of this Test

The intention of this article is to compare performance between ASP.NET WebForms and ASP.NET MVC. The main reasons for moving from Webforms to MVC are performance, performance and performance.

FYI: In case you are new to MVC tutorials, you can start from the video given at the end of the article.

Code for the Test

For this test, we created two projects, one in ASP.NET MVC and the other in ASP.NET Webforms. We have kept the test absolutely simple. Both the projects display 20 textboxes and there is a grid loaded with 1000 records.

Below is the ASP.NET Webform code behind which binds with a grid server control.

C#
        protected void Page_Load(object sender, EventArgs e)
        {
for(int i=0;i<1000;i++)
            {
obj.Add(DateTime.Now.ToString());
            }
            GridView1.DataSource = obj;
GridView1.DataBind();
        }
    }

On the ASPX UI, we have 20 textboxes which uses the server controls of ASP.NET Webforms.

ASP.NET
<asp:TextBox ID="TextBox1" runat="server" BackColor="#FF66FF"></asp:TextBox>

<asp:TextBox ID="TextBox2" runat="server" BackColor="#FF66FF">

<asp:TextBox ID="TextBox3" runat="server" BackColor="#FF66FF">

…….
<asp:TextBox ID="TextBox6" runat="server" BackColor="#FF66FF">

In ASP.NET MVC project also, we have similar kind of logic. We have 20 textboxes created using HTML control and a simple loop which creates an HTML table.

C#
<input id="Text1" type="text" style="background-color:#FF66FF" />

<input id="Text1" type="text" style="background-color:#FF66FF" />

<input id="Text1" type="text" style="background-color:#FF66FF" />

@{
List<string> obj = new List<string>();
for (int i = 0; i < 1000; i++)
{
obj.Add(DateTime.Now.ToString());
}
}

@{
foreach (string str in obj)
      {

      }
}
<table>
Item@str

Out of Scope

In this test, we have not used JSON, Jquery, Ajax because we wanted to test performance of these platforms only and not when they get clubbed with other technical things like HTML 5, Ajax, etc.

How Was the Test Conducted?

The test was conducted with the below specifications using VSTS and telerik load test software:

  • User load 25 users.
  • Run duration of test was 10 minutes.
  • Machine config DELL 8 GB Ram, Core i3
  • Project was hosted in IIS 8.
  • Project was created using MVC 5.
  • Network LAN connection was assumed. So this test does not account for network lag for now.
  • Browser in the test selected Chrome and Internet Explorer.
  • Multiple readings were 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.

Performance Criteria

Performance was measured using two criteria, Average page response time and Response content in bytes.

Average Page response time: This value is the average time the 25 users get the page output when the load testing is executed.

Response content length: Number of average total bytes transferred for every request. This criteria is taken because we suspect the server controls generate more amount of HTML as compared to when we write custom HTML.

Conclusion of Test

Response Time

Image 1

Response time of MVC was much better as compared to Webform. We found ASP.NET MVC response time was two times better than Webforms.

Image 2

The reason is but obvious. When a request is sent to Webforms, there is a complex ASP.NET page life cycle which gets executed in the code behind. This code behind is nothing but sort of conversion logic which converts the ASP.NET server controls to HTML.

In ASP.NET MVC, there is no code behind and no such conversion is required as the controls are in HTML format themselves.

Content Length

For the same kind of logic, the HTML content length generated from Webform was twice compared to MVC.

Image 3

When we viewed the view source, we saw huge view state data generated by Webform which was not present in MVC. This means more bandwidth will be consumed when we surf ASP.NET Webform sites as compared to ASP.NET MVC sites.

Image 4

ASP.NET MVC as Solution

If you see the conclusion from the load test, we need a solution which does not have code behind and server controls. So when you create ASP.NET MVC projects, you will not find NOcode behind and server controls.

Below is a snapshot of MVC views and you can see there is .CSHTML but there is no CSHTML.CS.

Image 5

If you go a MVC view and click on toolbox, it has HTML tab only and all the server controls have gone off completely.

Image 6

You can also read this detailed article which talks about what we missed in ASP.NET MVC from Webforms.

Below are all the seven readings pasted for both Webform and MVC. These readings would provide you more insight on the performance factor between these technologies.

Reading 1

Web Forms

Load Test Summary

Test Run Information

Load test name LoadTest1
Description  
Start time 1/11/2015 9:49:56 AM
End time 1/11/2015 9:59:56 AM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 19.2
Tests Failed 0
Avg. Test Time (sec) 1.26
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 19.2
Avg. Page Time (sec) 1.25
Requests/Sec 19.2
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 1.25
Avg. Content Length (bytes) 96,425

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/WebForm/WebForm... 2.30

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest1 2.32

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest1 Scenario1 11,510 0 (0) 1.26

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/WebForm/WebForm1.aspx Scenario1 WebTest1 1.25 11,510

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)

Controller and Agents Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 43.8 855

Errors

Type Subtype Count Last Message

MVC

Load Test Summary

Test Run Information

Load test name LoadTest2
Description  
Start time 1/11/2015 12:13:49 PM
End time 1/11/2015 12:23:49 PM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 46.0
Tests Failed 0
Avg. Test Time (sec) 0.49
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 46.0
Avg. Page Time (sec) 0.48
Requests/Sec 46.0
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 0.48
Avg. Content Length (bytes) 58,923

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/LoadTest/SomePa... 1.13

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest2 1.14

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest2 Scenario1 27,619 0 (0) 0.49

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/LoadTest/SomePage Scenario1 WebTest2 0.48 27,619

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)

Controller and Agents Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 63.0 1,012

Errors

Type Subtype Count Last Message

Reading 2

Webform

Load Test Summary

Test Run Information

Load test name LoadTest1
Description  
Start time 1/11/2015 10:25:53 AM
End time 1/11/2015 10:35:53 AM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 11.1
Tests Failed 0
Avg. Test Time (sec) 2.22
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 11.1
Avg. Page Time (sec) 2.20
Requests/Sec 11.1
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 2.20
Avg. Content Length (bytes) 100,276

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/WebForm/WebForm... 5.77

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest1 5.80

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest1 Scenario1 6,640 0 (0) 2.22

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/WebForm/WebForm1.aspx Scenario1 WebTest1 2.20 6,640

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)

Controller and Agents Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 61.2 841

Errors

Type Subtype Count Last Message

MVC

Load Test Summary

Test Run Information

Load test name LoadTest2
Description  
Start time 1/11/2015 1:03:06 PM
End time 1/11/2015 1:13:06 PM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 52.2
Tests Failed 0
Avg. Test Time (sec) 0.39
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 52.2
Avg. Page Time (sec) 0.39
Requests/Sec 52.2
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 0.39
Avg. Content Length (bytes) 46,281

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/LoadTest/SomePa... 1.02

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest2 1.03

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest2 Scenario1 31,330 0 (0) 0.39

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/LoadTest/SomePage Scenario1 WebTest2 0.39 31,330

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)

Controller and Agents Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 65.6 855

Errors

Type Subtype Count Last Message

Reading 3

WebForm

Load Test Summary

Test Run Information

Load test name LoadTest1
Description  
Start time 1/11/2015 11:04:01 AM
End time 1/11/2015 11:14:01 AM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 9.66
Tests Failed 0
Avg. Test Time (sec) 2.54
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 9.66
Avg. Page Time (sec) 2.52
Requests/Sec 9.66
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 2.52
Avg. Content Length (bytes) 99,769

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/WebForm/WebForm... 9.77

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest1 9.77

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest1 Scenario1 5,795 0 (0) 2.54

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/WebForm/WebForm1.aspx Scenario1 WebTest1 2.52 5,795

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)

Controller and Agents Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 61.0 875

Errors

Type Subtype Count Last Message

MVC

Load Test Summary

Test Run Information

Load test name LoadTest2
Description  
Start time 1/11/2015 1:28:54 PM
End time 1/11/2015 1:38:54 PM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 16.1
Tests Failed 0
Avg. Test Time (sec) 1.50
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 16.1
Avg. Page Time (sec) 1.49
Requests/Sec 16.1
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 1.49
Avg. Content Length (bytes) 57,923

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/LoadTest/SomePa... 2.93

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest2 2.94

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest2 Scenario1 9,647 0 (0) 1.50

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/LoadTest/SomePage Scenario1 WebTest2 1.49 9,647

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)

Controller and Agents Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 31.7 862

Errors

Type Subtype Count Last Message

Reading 4

WebForm

Load Test Summary

Test Run Information

Load test name LoadTest1
Description  
Start time 1/11/2015 11:28:39 AM
End time 1/11/2015 11:38:39 AM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 11.8
Tests Failed 7
Avg. Test Time (sec) 2.08
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 11.8
Avg. Page Time (sec) 2.06
Requests/Sec 11.8
Requests Failed 7
Requests Cached Percentage 0
Avg. Response Time (sec) 2.06
Avg. Content Length (bytes) 100,205

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/WebForm/WebForm... 5.58

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest1 5.60

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest1 Scenario1 7,073 7 (0.099) 2.08

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/WebForm/WebForm1.aspx Scenario1 WebTest1 2.06 7,073

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 75.8 922

Errors

Type Subtype Count Last Message
Http Error 500 - InternalServerError 7 500 - InternalServerError

MVC

Load Test Summary

Test Run Information

Load test name LoadTest2
Description  
Start time 1/11/2015 1:17:12 PM
End time 1/11/2015 1:27:12 PM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 30.8
Tests Failed 0
Avg. Test Time (sec) 0.65
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 30.8
Avg. Page Time (sec) 0.64
Requests/Sec 30.8
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 0.64
Avg. Content Length (bytes) 50,657

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/LoadTest/SomePa... 1.70

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest2 1.72

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest2 Scenario1 18,483 0 (0) 0.65

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/LoadTest/SomePage Scenario1 WebTest2 0.64 18,484

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 43.3 854

Errors

Type Subtype Count Last Message

Reading 5

Webform

Load Test Summary

Test Run Information

Load test name LoadTest1
Description  
Start time 1/11/2015 1:40:52 PM
End time 1/11/2015 1:50:52 PM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 18.8
Tests Failed 0
Avg. Test Time (sec) 1.32
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 18.8
Avg. Page Time (sec) 1.31
Requests/Sec 18.8
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 1.31
Avg. Content Length (bytes) 100,607

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/WebForm/WebForm... 2.55

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest1 2.56

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest1 Scenario1 11,261 0 (0) 1.32

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/WebForm/WebForm1.aspx Scenario1 WebTest1 1.31 11,261

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

6 System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 60.8 891

6 Errors

Type Subtype Count Last Message

MVC

Load Test Summary

Test Run Information

Load test name LoadTest2
Description  
Start time 1/11/2015 2:30:38 PM
End time 1/11/2015 2:40:38 PM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 34.3
Tests Failed 0
Avg. Test Time (sec) 0.68
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 34.3
Avg. Page Time (sec) 0.68
Requests/Sec 34.3
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 0.68
Avg. Content Length (bytes) 57,923

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/LoadTest/SomePa... 1.60

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest2 1.61

6 Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest2 Scenario1 20,603 0 (0) 0.68

6 Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/LoadTest/SomePage Scenario1 WebTest1 0.68 20,603

6 Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

6 System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 54.4 915

6 Errors

Type Subtype Count Last Message

Reading 6

Webform

Load Test Summary

Test Run Information

Load test name LoadTest1
Description  
Start time 1/11/2015 2:15:21 PM
End time 1/11/2015 2:25:21 PM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 10.7
Tests Failed 0
Avg. Test Time (sec) 1.98
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 10.7
Avg. Page Time (sec) 1.96
Requests/Sec 10.7
Requests Failed 0
Requests Cached Percentage 0
Avg. Response Time (sec) 1.96
Avg. Content Length (bytes) 101,007

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/WebForm/WebForm... 3.77

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest1 3.79

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest1 Scenario1 6,395 0 (0) 1.98

Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/WebForm/WebForm1.aspx Scenario1 WebTest1 1.96 6,395

Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)

Controller and Agents Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 60.4 188

Errors

Type Subtype Count Last Message

MVC

Load Test Summary

Test Run Information

Load test name LoadTest2
Description  
Start time 1/11/2015 2:41:57 PM
End time 1/11/2015 2:51:57 PM
Warm-up duration 00:00:00
Duration 00:10:00
Controller Local run
Number of agents 1
Run settings used Run Settings1

Overall Results

Max User Load 25
Tests/Sec 20.4
Tests Failed 0
Avg. Test Time (sec) 0.67
Transactions/Sec 0
Avg. Transaction Time (sec) 0
Pages/Sec 20.4
Avg. Page Time (sec) 0.66
Requests/Sec 20.4
Requests Failed 4
Requests Cached Percentage 0
Avg. Response Time (sec) 0.66
Avg. Content Length (bytes) 57,904

Key Statistic: Top 5 Slowest Pages

URL (Link to More Details) 95% Page Time (sec)
http://192.168.15.141:98/LoadTest/SomePa... 1.38

Key Statistic: Top 5 Slowest Tests

Name 95% Test Time (sec)
WebTest2 1.39

Test Results

Name Scenario Total Tests Failed Tests (% of total) Avg. Test Time (sec)
WebTest2 Scenario1 12,220 4 (0.033) 0.67

6 Page Results

URL (Link to More Details) Scenario Test Avg. Page Time (sec) Count
http://192.168.15.141:98/LoadTest/SomePage Scenario1 WebTest2 0.66 12,220

6 Transaction Results

Name Scenario Test Response Time (sec) Elapsed Time (sec) Count

6 System Under Test Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)

6 Controller and Agents Resources

Machine Name % Processor Time Available Memory at Test Completion (Mb)
USER-PC 59.0 852

6 Errors

Type Subtype Count Last Message
Exception SocketException 4 An existing connection was forcibly closed by the remote host

So if you are convinced that ASP.NET MVC is the way to go ahead, how about starting to learn MVC right away now. Below is an awesome ASP.NET MVC video which teaches MVC in 16 hours flat.

Image 7

(MUF) Must Used Feature Approach of Testing

Lot of developers would raise eyebrows on the above test stating that:

  • We have the option of disabling viewstate
  • We have the option of using HTML over server controls
  • and so on...

Yes, we agree completely that webforms can be tweaked to run in an optimal way and they can have nearly the same performance as ASP.NET MVC.

But this test followed the most used feature approach. In general, when Webform is used 99% times, developers do not disable view state, they use code behind, they use server controls left and right and so on.

Because if we go that route of testing, then ASP.NET MVC also has lot of best practices like jQuery, JSON, etc. to improve performance.

So this test was conducted keeping what is the most used feature in both Webform and MVC. Both these technologies where kept at ground zero and compared using their most used feature in the market.

Option vs Compulsion

If you are taken to a bar and you are given a choice of drinking wine or juice. There is high possibility you will drink wine… temptation, human nature whatever you term it as.

But if you are taken to a juice shop, you do not have options and you are compelled to drink only juice.

ASP.NET Webform gives you an option while MVC forces you to follow best practices. So with Webform, I have options of using HTML, disable view state but the human temptation of RAD is so profound that most of the time, people end up using these features.

On the other hand, MVC does not give you the option of code behind, server controls, view state, etc. thus compelling you to use pure HTML and without behind code architecture.

Further Reading

We encourage you to read the below articles as well to enhance your ASP.NET MVC knowledge further.

If you want to start Learning MVC, this MVC article teaches ASP.NET MVC step by step in 7 days.

These two articles are a great read if you want to know in detail about MVC VS Webforms.

If you are preparing for MVC interview, do not this miss 100 ASP.NET MVC interview question series.

For Further Reading do watch the below Interview preparation videos and step by step video series.

History

  • 13th January, 2015: Initial version

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect https://www.questpond.com
India India

Written By
Founder Just Compile
India India
Learning is fun but teaching is awesome.

Who I am? Trainer + consultant + Developer/Architect + Director of Just Compile

My Company - Just Compile

I can be seen in, @sukeshmarla or Facebook

Comments and Discussions

 
General[My vote of 1] I still prefer (a light version of) Webforms over MVC Pin
f0rwardz20-Apr-18 10:38
f0rwardz20-Apr-18 10:38 
QuestionMVC is faster, but also much easier Pin
Anthony Morgan22-Jun-17 4:04
Anthony Morgan22-Jun-17 4:04 
QuestionA total false comparison! Pin
Dewey10-Feb-16 19:38
Dewey10-Feb-16 19:38 
AnswerRe: A total false comparison! Pin
Shivprasad koirala12-Jan-18 17:00
Shivprasad koirala12-Jan-18 17:00 
GeneralWhy 'My Vote of 1' Pin
guibirow5-Jan-16 4:33
guibirow5-Jan-16 4:33 
GeneralRe: Why 'My Vote of 1' Pin
Shivprasad koirala12-Jan-18 16:54
Shivprasad koirala12-Jan-18 16:54 
Question[My vote of 1] My note of 1 Pin
Michael-Jorge Gómez Campos24-Sep-15 20:16
Michael-Jorge Gómez Campos24-Sep-15 20:16 
AnswerRe: [My vote of 1] My note of 1 Pin
Shivprasad koirala24-Sep-15 20:29
Shivprasad koirala24-Sep-15 20:29 
GeneralRe: [My vote of 1] My note of 1 Pin
Michael-Jorge Gómez Campos24-Sep-15 22:28
Michael-Jorge Gómez Campos24-Sep-15 22:28 
GeneralRe: [My vote of 1] My note of 1 Pin
Shivprasad koirala12-Jan-18 16:58
Shivprasad koirala12-Jan-18 16:58 
QuestionNotepad is faster than Word Pin
F-ES Sitecore13-Aug-15 22:55
professionalF-ES Sitecore13-Aug-15 22:55 
AnswerRe: Notepad is faster than Word Pin
Shivprasad koirala24-Sep-15 20:35
Shivprasad koirala24-Sep-15 20:35 
GeneralRe: Notepad is faster than Word Pin
F-ES Sitecore24-Sep-15 21:36
professionalF-ES Sitecore24-Sep-15 21:36 
GeneralArticle of the day by Microsoft ASP.Net Technical community Pin
Gaurav Aroraa25-Mar-15 6:51
professionalGaurav Aroraa25-Mar-15 6:51 
GeneralRe: Article of the day by Microsoft ASP.Net Technical community Pin
Marla Sukesh25-Mar-15 6:53
professional Marla Sukesh25-Mar-15 6:53 
GeneralRe: Article of the day by Microsoft ASP.Net Technical community Pin
Member 1272243720-Sep-16 2:14
Member 1272243720-Sep-16 2:14 
GeneralRe: Article of the day by Microsoft ASP.Net Technical community Pin
citizendc29-Dec-16 20:54
citizendc29-Dec-16 20:54 
GeneralRe: Article of the day by Microsoft ASP.Net Technical community Pin
Shivprasad koirala12-Jan-18 17:06
Shivprasad koirala12-Jan-18 17:06 
GeneralMy vote of 5 Pin
D V L11-Feb-15 23:42
professionalD V L11-Feb-15 23:42 
QuestionMy vote of 5 Pin
Liju Sankar9-Feb-15 0:33
professionalLiju Sankar9-Feb-15 0:33 
GeneralMy vote of 5 Pin
Raul Iloc8-Feb-15 20:59
Raul Iloc8-Feb-15 20:59 
GeneralMy vote of 5 Pin
Mahsa Hassankashi7-Feb-15 23:19
Mahsa Hassankashi7-Feb-15 23:19 
SuggestionUnfair comparison... and not because of viewstate PinPopular
AndrewLansdowne20-Jan-15 23:16
AndrewLansdowne20-Jan-15 23:16 
GeneralRe: Unfair comparison... and not because of viewstate Pin
Marla Sukesh25-Mar-15 7:18
professional Marla Sukesh25-Mar-15 7:18 
QuestionRe: MVC is Technically Driven While WebForms is Business Driven PinPopular
Steve Naidamast19-Jan-15 7:07
professionalSteve Naidamast19-Jan-15 7:07 
I have worked with MVC in the past. In fact, in 2010 I worked on probably one of the largest MVC projects in the United States at the time. I am also a senior software engineer with over 40 years in the IT profession so I have seen it all...

As a result, I believe my thoughts on this development paradigm should be taken with some seriousness when choosing, which paradigm to work with.

All of the points that the author of this article presents appear to be quite well founded. However, and this is a big "BUT", the idea of performance in web applications is a completely erroneous supposition. The Internet was not designed (and it still has not changed) with performance in mind but instead with "concurrency". The two are mutually exclusive and cannot be reconciled with each other. As it goes then, the more concurrent users on a site, the slower it will perform.

Most of what is gained by using MVC is done through kludges to the original design of how the Internet actually works. Yes, MVC is a "purer" methodology that does in fact restrict itself to the literal workings of the Internet but it comes at a high price using a lot of additional code and foundations that are more or less hidden from view with WebForms.

This is neither good nor bad. However, in terms of what most developers will have to deal with in terms of fulfilling business application requirements, MVC will most definetely put them behind the 8-ball in terms of attempting to compete with deadlines and literal, technical interpretations as to how the Internet actually works.

MVC not only takes a greater understanding of the Internet as a whole but it also requires a lot of additional knowledge which can be more easily done with WebForms.

Is WebForms somewhat more "bloated" than MVC? Of course it is, which is why you also have a lot of convenient features with it that MVC lacks. For everything you get with WebForms, you have to create by hand with MVC unless you are using additional frameworks to make up for these lack of features. And if you are doing this then you are simply trading one way of implementing the required features for another. There is little gain.

MVC is most definetly not a good solution for database intensive applications with a lot of complex forms. You will spend your days writing a lot of extra code and doing a lot of extra testing with the subsequent amount of development defects to correct. And even the less complex forms have their additional requirements.

When considering MVC you have to also seriously consider the requirements it will be applied against for any specific project. And when considering business requirements MVC simply cannot compete with WebForms since all of the benefits of MVC are purely technical. There is no advantage or benefit to any business to implement MVC applications unless there is a very specific need to do so and this will be a rarity.

The major project I worked on with MVC did in fact work out quite well and we were only using MVC-2 at the time. However, the project only worked from a technical standpoint. In other words, everything that MVC promised as a paradigm worked as expected. However, from a business standpoint, the paradigm was a complete failure. Unable to compete with the demands for requirements and time, the project, directly a result of MVC failed to provide the necessary completed milestones that the client required.

The decision to use MVC was made before I joined the project but I could quickly see that it would eventually lead to exactly what it did, disaster.

Eventually the client canceled the project, though it provided for all the known requirements. The development process was simply too slow as a result.

MVC has been popularized over the years as the "correct" way to develop for the Internet. News Flash! There is no correct way to develop for the Internet since it was never designed to handle the amount of data that is currently going over it or the applications that support the data. The Internet is a messaging system and as such maintains the same topology that it was designed with in the 1960s/1970s. Faster lines may have been implemented but that is about it.

The idea behind developing good applications is to design them well with a lot of common-sense. MVC is being used to replace common-sense with a paradigm that to many has become a technical ideology. You can develop very fine Internet systems with WebForms using the same concepts as one would apply against MVC in terms of cleanliness and functionality. However, like WebForms, MVC has its drawbacks and can be subject to as much sloppiness as WebForms.

Though the article concentrates on MVC performance, just remember that performance is a relative thing on the Internet and practically all well implemented paradigms will yield acceptable performance levels...
Steve Naidamast
Sr. Software Engineer
blackfalconsoftware@outlook.com

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.