Webforms 与 Asp.Net MVC VS2010 负载测试
我的一位同事使用 VS2010 对 Webforms 项目和 Asp.net MVC 项目进行了简单的负载测试,发现 Webforms 每秒处理大约 83 个请求,而 Asp.net MVC 每秒处理 28 个请求。这两个网站都发布在具有相似设置的同一服务器上。
Webforms 项目有 10 个页面,其中 5 个页面使用标签显示简单的文本消息,另外 5 个页面有文本框控件。 Asp.net MVC 站点中内置了类似的功能,因此输出与 Webforms 页面相同。在恒定负载和增量负载下运行测试,结果相似。
我对结果有点惊讶。有谁知道为什么 MVC 比 Webforms 慢? 谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
唔。由于没有太多信息可继续,也许您应该检测您的代码,看看什么需要一段时间和/或 Web 表单和 MVC 之间的区别。
您可以使用一些面向方面的编程技术来消除所有这些日志命令的负担。
这是一个这样的框架:
http://code.google.com/p /postsharp-user-plugins/wiki/Log4PostSharp
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.
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