Click here to Skip to main content
13,792,957 members
Click here to Skip to main content
Add your own
alternative version

Stats

164.2K views
82 bookmarked
Posted 13 Jan 2015
Licenced CPOL

ASP.NET MVC vs ASP.NET WebForm performance comparison

Rate this:
Please Sign up or sign in to vote.
The intention of this article is to compare performance between ASP.NET WebForms and ASP.NET MVC. One the main reasons of moving from Webforms to MVC is performance, performance and performance.

Contents

Intention of this test
Code for the test
Out of scope
How was the test conducted?
Performance criteria
Conclusion of test
ASP.NET MVC as solution
Reading 1
Web Forms
MVC
Reading 2
Webform
MVC
Reading 3
WebForm
MVC
Reading 4
WebForm
MVC
Reading 5
Webform
MVC
Reading 6
Webform
MVC
(MUF) Must used Feature approach of testing
Option vs Compulsion
Further reading

Intention of this test

The intention of this article is to compare performance between ASP.NET WebForms and ASP.NET MVC.One the main reasons of moving from Webforms to MVC is 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.

        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: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 simple loop which creates HTML table.

<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?

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 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.

Performance criteria

Performance was measured using two criteria’s 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

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

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 themself.

Content length

For the same kind of logic the HTML content length generatedfrom Webform was twice than MVC.

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.

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.

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

You can also read this in depth article which talk about what we have 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.

(MUF) Must used Feature approach of testing

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

  • We have option of disabling viewstate.
  • We have 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 near by  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 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 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.

http://www.codeproject.com/Articles/528117/WebForms-vs-MVC
http://www.codeproject.com/Articles/821275/Webforms-vs-MVC-and-Why-MVC-is-better
  • 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 of MVC VS Webforms.
  • If you are preparing for MVC interview do not this miss 100 ASP.NET MVC interview question series.

License

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

Share

About the Authors


Marla Sukesh
Instructor / Trainer Train IT
India India
Learning is fun but teaching is awesome.

Code re-usability is my passion ,Teaching and learning is my hobby, Becoming an successful entrepreneur is my goal.

By profession I am a Corporate Trainer.
I do trainings on WCF, MVC, Business Intelligence, Design Patterns, HTML 5, jQuery, JSON and many more Microsoft and non-Micrsoft technologiees.

Find my profile here



My sites



@Twitter
@Facebook

You may also be interested in...

Comments and Discussions

 
General[My vote of 1] I still prefer (a light version of) Webforms over MVC Pin
stommesite20-Apr-18 11:38
memberstommesite20-Apr-18 11:38 
QuestionMVC is faster, but also much easier Pin
Anthony Morgan22-Jun-17 5:04
memberAnthony Morgan22-Jun-17 5:04 
QuestionA total false comparison! Pin
Dewey10-Feb-16 20:38
memberDewey10-Feb-16 20:38 
AnswerRe: A total false comparison! Pin
Shivprasad koirala12-Jan-18 18:00
mvpShivprasad koirala12-Jan-18 18:00 
GeneralWhy 'My Vote of 1' Pin
guibirow5-Jan-16 5:33
memberguibirow5-Jan-16 5:33 
GeneralRe: Why 'My Vote of 1' Pin
Shivprasad koirala12-Jan-18 17:54
mvpShivprasad koirala12-Jan-18 17:54 
Question[My vote of 1] My note of 1 Pin
Michael-Jorge Gómez Campos24-Sep-15 21:16
memberMichael-Jorge Gómez Campos24-Sep-15 21:16 
AnswerRe: [My vote of 1] My note of 1 Pin
Shivprasad koirala24-Sep-15 21:29
mvpShivprasad koirala24-Sep-15 21:29 
GeneralRe: [My vote of 1] My note of 1 Pin
Michael-Jorge Gómez Campos24-Sep-15 23:28
memberMichael-Jorge Gómez Campos24-Sep-15 23:28 
GeneralRe: [My vote of 1] My note of 1 Pin
Shivprasad koirala12-Jan-18 17:58
mvpShivprasad koirala12-Jan-18 17:58 
QuestionNotepad is faster than Word Pin
F-ES Sitecore13-Aug-15 23:55
mvpF-ES Sitecore13-Aug-15 23:55 
AnswerRe: Notepad is faster than Word Pin
Shivprasad koirala24-Sep-15 21:35
mvpShivprasad koirala24-Sep-15 21:35 
GeneralRe: Notepad is faster than Word Pin
F-ES Sitecore24-Sep-15 22:36
mvpF-ES Sitecore24-Sep-15 22:36 
GeneralArticle of the day by Microsoft ASP.Net Technical community Pin
Gaurav Aroraa25-Mar-15 7:51
professionalGaurav Aroraa25-Mar-15 7:51 
GeneralRe: Article of the day by Microsoft ASP.Net Technical community Pin
Marla Sukesh25-Mar-15 7:53
mvp Marla Sukesh25-Mar-15 7:53 
GeneralRe: Article of the day by Microsoft ASP.Net Technical community Pin
Member 1272243720-Sep-16 3:14
memberMember 1272243720-Sep-16 3:14 
GeneralRe: Article of the day by Microsoft ASP.Net Technical community Pin
citizendc29-Dec-16 21:54
membercitizendc29-Dec-16 21:54 
GeneralRe: Article of the day by Microsoft ASP.Net Technical community Pin
Shivprasad koirala12-Jan-18 18:06
mvpShivprasad koirala12-Jan-18 18:06 
GeneralMy vote of 5 Pin
D V L12-Feb-15 0:42
professionalD V L12-Feb-15 0:42 
QuestionMy vote of 5 Pin
Liju Sankar9-Feb-15 1:33
professionalLiju Sankar9-Feb-15 1:33 
GeneralMy vote of 5 Pin
Raul Iloc8-Feb-15 21:59
professionalRaul Iloc8-Feb-15 21:59 
GeneralMy vote of 5 Pin
Mahsa Hassankashi8-Feb-15 0:19
mvpMahsa Hassankashi8-Feb-15 0:19 
SuggestionUnfair comparison... and not because of viewstate PinPopular
AndrewLansdowne21-Jan-15 0:16
memberAndrewLansdowne21-Jan-15 0:16 
GeneralRe: Unfair comparison... and not because of viewstate Pin
Marla Sukesh25-Mar-15 8:18
mvp Marla Sukesh25-Mar-15 8:18 
QuestionRe: MVC is Technically Driven While WebForms is Business Driven PinPopular
Steve Naidamast19-Jan-15 8:07
professionalSteve Naidamast19-Jan-15 8:07 

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.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01 | 2.8.181207.3 | Last Updated 19 Jan 2015
Article Copyright 2015 by Shivprasad koirala, Marla Sukesh
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid