开发者

Which performs best: Classic ASP, ASP.NET WebForms or ASP.NET MVC?

开发者 https://www.devze.com 2023-03-06 19:38 出处:网络
i have recently converted a classic asp application to ASP.NET 3.5, but i feel t开发者_StackOverflow社区hat my Classic ASP version was a bit faster (i don\'t know may be buyers remorse).

i have recently converted a classic asp application to ASP.NET 3.5, but i feel t开发者_StackOverflow社区hat 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.


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.


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.


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.


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 reading

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


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消