What's the reason of ASP.NET pages being slow, as compared to page when developed in PHP

Re: Hot Technology Why the ASP.NET Pages are slow ???

Manan Thakkar


.NET compiles code, such as C#, into what its creators have termed MSIL, or Microsoft Intermediate Language. This roughly resembles Java's bytecode, the "binary" you have after you compile the source code. PHP, as an interpreted language, doesn't really have an equivalent here. I use quotes because it is different from the binary you get when compiling C, C++, and so on. In those cases, you compile to a machine language specific to your processorí¬ essentially, coded instructions that only your processor can understand. A C program compiled on a Mac OS X compiler would produce different code from that same program compiled with a Linux C compiler. With bytecode, or MSIL, you have an executable that cannot run directly on any machine without a runtime environment. That is what Microsoft's .NET Common Language Runtime (CLR) provides. That layer would differ on different platforms implemented to execute those binaries and convert them to machine language at execution time.

Saying that PHP is strictly interpreted and that ASP.NET code is compiled is a bit misleading, as evidenced by the common language runtime environment I've described. What's more, with PHP as well as ASP.NET pages, you can configure your respective Web servers to do connection pooling and caching of those pages, so they don't have to be recompiled each time. Inevitably, those PHP pages will compile into smaller pieces than the equivalent ASP.NET page, because there is more overhead with the intermediate compilation with the CLR. Ultimately, this will mean greater memory requirements on your Web server.


Mark this as Answer.


Re: Hot Technology Why the ASP.NET Pages are slow ???

Andreas Johansson

Not sure why Manan wants his reply to be marked as an answer. His reply doesn't really say why PHP seem to be faster than ASP.NET and it is actually not possible to answer that without knowing more about how the original poster came to that conclusion.

I haven't tried out PHP for a long time but ASP.NET is a richer framework and as Manan also mentiones it will require more from the server so if you only meet the minimum requirements for ASP.NET it might be a reason it is running slower.

For more ideas why PHP seem faster than ASP.NET you should provide more details how you come to that conclusion, what the pages are doing, what is actually slower and how you come to that conclusion.

Re: Hot Technology Why the ASP.NET Pages are slow ???

Bharat Bhushan

Hi -

PHP is not faster then ASP.net. If we have two pages having same stuff.

ASP.net will win, if u have created them with best approch.

Usually developer miss use the rich functionality provided by ASP.net

Re: Hot Technology Why the ASP.NET Pages are slow ???


depending on the exact nature of your task, and your choice of implementation, PHP OR ASP.NET can be faster. as has been mentioned, you need to employ appropriate better/best practices in either environment in order to achieve the best results. I think a search is a bad example, as this typically relies on the DBMS behind the search as much as, or more than, the coding language employed. If you're in an enterprise environment, ASP.NET has the advantage -- it can make use of remoting services, which I believe has no analog in PHP. If you're trying to parse a string, I believe PHP is faster than C#, even with recent string handling improvements in .NET -- I believe reg ex is understood natively in PHP, like Perl, whereas .NET languages have an object architecture wrapping regular expressions.

Poorly configured PHP apps are dogs, just as poorly configured ASP.NET apps are.

Re: Hot Technology Why the ASP.NET Pages are slow ???

Jay Vora

andrewbadera is quite right ...it depends on ur load of appli how much it takes to run.

Gudd info as well by Manan Thakkar.