Webforms与Asp.Net MVC VS2010 LoadTest

时间:2021-09-09 06:06:37

A colleague of mine ran a simple load test using VS2010 on a Webforms project and an Asp.net MVC project and noticed that Webforms was serving around 83 requests per second whereas Asp.net MVC was serving 28 requests per second. Both the sites were published on the same server with similar settings.
Webforms project had 10 pages 5 of them displayed simple text messages using labels and the other 5 had text box controls. Similar functionality was built into the Asp.net MVC site so that the output is the same as the Webforms pages. Tests were run with both constant load and incremental load with similar results.
I am a little surprised with the results. Does anyone know why MVC is slower that Webforms? Thanks!

我的一位同事在Webforms项目和Asp.net MVC项目上使用VS2010进行了简单的负载测试,并注意到Webforms每秒服务大约83个请求,而Asp.net MVC每秒服务28个请求。两个站点都在具有类似设置的同一服务器上发布。 Webforms项目有10页,其中5页使用标签显示简单的短信,另外5页有文本框控件。类似的功能内置于Asp.net MVC站点,因此输出与Webforms页面相同。测试在恒定负载和增量负载下运行,结果相似。我对结果感到有些惊讶。有谁知道为什么MVC比Webforms慢?谢谢!

1 个解决方案

#1


0  

Hmm. Without much info to go on, perhaps you should instrument your code to see what's taking a while and/or the difference between Web Forms and MVC.

嗯。如果没有太多信息,也许您应该检测代码以查看Web Forms和MVC之间的差异和/或差异。

You might use some aspect oriented programming techniques to remove the burden of all those logging commands.

您可以使用一些面向方面的编程技术来消除所有这些日志记录命令的负担。

Here's one such framework:

这是一个这样的框架:

http://code.google.com/p/postsharp-user-plugins/wiki/Log4PostSharp

#1


0  

Hmm. Without much info to go on, perhaps you should instrument your code to see what's taking a while and/or the difference between Web Forms and MVC.

嗯。如果没有太多信息,也许您应该检测代码以查看Web Forms和MVC之间的差异和/或差异。

You might use some aspect oriented programming techniques to remove the burden of all those logging commands.

您可以使用一些面向方面的编程技术来消除所有这些日志记录命令的负担。

Here's one such framework:

这是一个这样的框架:

http://code.google.com/p/postsharp-user-plugins/wiki/Log4PostSharp