哪个性能最好:经典 ASP、ASP.NET WebForms 还是 ASP.NET MVC?
我最近将一个经典的 ASP 应用程序转换为 ASP.NET 3.5,但我觉得我的经典 ASP 版本更快一点(我不知道可能是买家后悔)。
那么你们能帮我解决这个问题并让我知道哪一个更快,asp、asp.net 或 ASP.NET MVC。
我搜索了这个问题,但没有找到任何内容,如果您找到任何内容,请指出该问题并将我的问题标记为重复
谢谢大家。
i have recently converted a classic asp application to ASP.NET 3.5, but i feel that my Classic ASP version was a bit faster (i don't know may be buyers remorse).
So can you guys help me with this and let me know which one is faster, asp, asp.net or ASP.NET MVC.
I searched for this question on so and didn't find anything, if you find anything, please point to that question and mark my question as duplicate
Thank you guys.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
经典 ASP 将在每次页面请求时解释页面的脚本。 ASP.NET 将编译该页面的代码一次。 ASP.NET 几乎总是比经典 ASP 表现得更好。 ASP.NET MVC 只是编写 ASP.NET 应用程序的一种(更好?)方法。
另外,我认为 ASP.NET 的功能远远优于经典 ASP。如果您选择 ASP.NET,您应该能够花费更少的开发人员资源来创建更复杂的网站。
Classic ASP will interpret the script for a page on every page request. ASP.NET will compile the code for the page once. ASP.NET will almost always perform better than classic ASP. ASP.NET MVC is simply a (better?) way to write ASP.NET applications.
Also, in my oppinion the features ASP.NET is far superior to classic ASP. You should be able to spend fewer developer resources on creating a more complex website if you choose ASP.NET.
由于 ASP 使用解释代码而 ASP.NET 使用编译代码,因此 ASP.NET 执行代码的速度要快得多。
但是,这并不自动意味着 ASP.NET 应用程序总是比 ASP 应用程序更快。性能很大程度上取决于数据库效率以及服务器和浏览器之间发送的数据量。
使用 ASP.NET Web 表单时,很容易在服务器和浏览器之间来回发送的视图状态中产生大量开销,这可能就是您在应用程序中看不到太多改进的原因。
ASP.NET MVC 没有使用视图状态的相同形式的控件,因此您不会轻易积累开销。
As ASP uses interpreted code and ASP.NET uses compiled code, ASP.NET is waaaay faster to execute code.
However, this does not automaticaly mean that an ASP.NET application always is faster than an ASP application. A lot of the performance depends on database efficiency and how much data you send between the server and the browser.
When using ASP.NET webforms, it's easy to get a lot of overhead in the viewstate that is send back and forth between the server and browser, which is probably why you don't see much of an improvement in your application.
ASP.NET MVC doesn't have the same form of controls that uses viewstate, so you won't accumulate overhead as easily.
说“x 比 y 快”总是有点过分,但我认为这是一个我可以说 Classic ASP 比 ASP.net 慢的例子,不包括您可能会发现的一些边缘情况,其中之一主要原因是经典 ASP 被解释而 ASP.net 被编译。
It's always a bit of a sin to say "x is faster than y" but I think this is an instance where I can say Classic ASP is slower than ASP.net, excluding a few edge cases you might be able to find, one of the main reasons being Classic ASP is interpreted and ASP.net is compiled.
就性能而言,经典 ASP 肯定较慢,原因很简单,ASP.Net 是编译的,而经典 ASP 是解释的。
的 Page 对象的基础)
ASP.Net MVC 和 ASP.Net WebForms 都构建在
IHttpHandler
之上(MVC/WebForms 中使用 ASP.Net WebForms 或 ASP.Net MVC,您可以使用HttpHandler
更快地提供服务 (.ashx)。 进一步阅读由于一些臃肿的客户端框架(大量的 JS 库)和约定,ASP.Net WebForms 在客户端通常较重(较慢)作为
ViewState
。进一步阅读
In terms of performance, Classic ASP is definitely slower, for the simple reason that ASP.Net is compiled, and Classic ASP is intepreted.
ASP.Net MVC and ASP.Net WebForms both build on top of
IHttpHandler
(the basis of the Page object used in MVC/WebForms)Using ASP.Net WebForms or ASP.Net MVC, you can use
HttpHandler
to serve things up faster (.ashx). Further readingASP.Net WebForms is often heavier (slower) on the client-side due to some bloated client-side framework (heavy JS libraries) and conventions suchs as the
ViewState
.Further Reading
ASP.NET 中的某些事情在不编写大量代码的情况下并不那么简单。我相信,如果您的 ASP 代码速度更快并且您正在做简单的事情,那么您最好继续使用它。如果我能比 ASP.NET 更快地完成它,我仍然使用经典 ASP 进行构建。
我觉得 .NET 适用于复杂的站点或项目,只有最好的才足够......但我可能是错的。在 ASP 中,您可以根据客户的需要进行大量的修改。
Some things in ASP.NET are not as simple to do without writing much code. I believe if your ASP code was faster and you're doing simple things then you're better of staying with it. I still build in classic ASP if i can get it done faster than ASP.NET.
I feel .NET is for complex sites or projects where only the best will suffice..but i may be wrong. In ASP you can do a lot of bastardization the client wants.
经典 ASP 是一种解释性脚本语言。 ASP.NET 编译为机器代码,因此它很可能会更快(经典 ASP 中可能存在一些边缘情况和 Wierdo 优化)。
ASP.NET MVC 只是 ASP.NET 运行时之上的一个薄层。
Classic ASP is an interpreted scripting language. ASP.NET compiles down to machine code, so it will most likely be significantly faster (there might be some edge cases and wierdo optimizations in Classic ASP).
ASP.NET MVC is just a thin layer on top of ASP.NET Runtime.
人们自然而然地认为编译的应用程序总是比解释的应用程序运行得更快。虽然这通常是正确的(C# 代码的运行速度几乎总是比 VBScript 快得多),但您必须查看存在的其他依赖项以及应用程序运行的环境。
事实上,大多数时候,在简单的 Web 应用程序中,您请求一个网页,从数据库中获取其关联数据,然后将其返回到浏览器,两者之间的差异可以忽略不计。从数据库请求和返回数据可能至少消耗页面处理的 60%,另外 30% 是创建响应的 Web 服务器。
例如,设计不当的 SQL 查询会比您所使用的所选语言以指数方式减慢您的应用程序的速度。请记住,一切都与算法有关!
在这里尽量保持客观,但我注意到使用 C# 和 ASP 的 ASP.NET MVC 将相同的数据返回到相同的网页时,差异可以忽略不计。我认为使用 Spring MVC 或 PHP,甚至使用 Visual Basic 的 ASP.NET MVC,您会看到相同的结果。
也就是说,我更愿意每次都使用 ASP.NET MVC,因为它使我可以选择使用异步控制器和异步操作。我还喜欢设计具有有意义对象的应用程序。除非您使用 ActiveX 用 C++ 编写后端,否则不可能使用 OOP 来实现 ASP,这对于现代应用程序来说是一个丑陋的解决方案。
ASP 不太适合 SOC(关注点分离),因此大多数 ASP 应用程序就像一个厨房水槽,里面放着一周的脏盘子。
People automatically assume that a compiled application will ALWAYS run faster than an interpreted application. While that's generally true, (C# code will almost always run exponentially faster than VBScript), you have to look at the other dependencies that exist and the environment in which the application is run.
In reality, most of the time there's a negligible difference in a simple web application where you're requesting a web page, grabbing it's associated data from a database and then returning it to the browser. Requesting and returning data from the database probably consumes at least 60% of the processing of the page, another 30% is the web server creating the response.
Example, a poorly designed SQL query will slow down your app exponentially more than the chosen language you're using. Remember, it's all about the algorithm!
Trying to be objective here, but I've noticed only negligible difference in returning the same data to the same web page with ASP.NET MVC with C# and ASP. I think you'd see the same results with Spring MVC or PHP, or even ASP.NET MVC with Visual Basic.
That said, I would prefer to use ASP.NET MVC everytime because it gives me the option of using asynchronous controllers and asynchronous actions. I also like to design an application with meaningful objects. It's impossible to do ASP with OOP unless your writing the back end in C++ with ActiveX, which is an ugly solution for modern applications.
ASP doesn't lend itself well to SOC (Separation of Concerns), so most ASP apps resemble a kitchen sink with a weeks worth of dirty dishes.
在同一服务器上使用数据库检索对相同功能进行实际代码测试 asp 速度要快得多,asp.net 是一个臃肿软件。
ASP 被微软终止了,因为从战略上讲,它是免费的、独立的,需要很少的工具,并且将成为 php 的竞争对手,从本质上讲,php 不会让微软在未来的
逻辑上销售更多的工具和升级,即使我不可信,捆绑一个从未使用过的整套代码永远不会更快
actual code test for same function using database retrieval on the same server asp is faster by much, asp.net is a bloatware .
asp was discontinued by microsoft because strategically it is free and standalone requiring little tools and will have been the competitor to php which essentially will not allow microsoft to sell more tools and upgrades in future
logic wise even if i am not to be believed, bundling a whole suite of code that is never used will never be faster