ASP.Net vs PHP speed test

sharp-developer

Newcomer
Joined
Mar 29, 2007
Messages
1
Split from Here - PD

If you're using MS SQL then use a language that was built to actually use it, .NET. PHP was built to use MySQL.

The only true way to test is to fill a table with 1 million records and do speed tests for retrieving and updating the table with both technologies. If numbers come out similar then ask yourself; which program would be easier to update in the future if built correctly using OOP techniques and save the company time and money? The answer to that is simple, .NET.

Nice article from Peter Bromber ASP.NET vs PHP or PHP.NET?. May be you could have both and even under Linux/Mono?
 
Last edited by a moderator:
AFAIK. Compiled language runs faster than interpreted language. That's one think I know for sure. Too bad I can't find enough reference to prove that. Sorry.
 
Not that I am trying to tell your manager how to di his job but..
Although speed may be one of the key factors that your manager needs to test before choosing a language, there are also other factors that I think you should remind him of.
Like cost, development time, support, manageability, scaleability and of course maintenance.
And you did mention that you will be using SQLServer, the previous posts are correct in saying use ASP.Net because it is built to run with SQLServer.
My 2 cents:
 
Just a heads up, but this thread is almost 4 years old. While a discussion on the pros and cons of PHP versus ASP.net are both interesting and relevant (in my opinion) whatever project Evil_homer had in mind is very likely long completed for good or ill.

Why don't you guys continue this discussion in the "random thoughts" section? I'm sure some folks will weigh in with their opinions. Plus this is a discussion that probably should happen as technology and the way we build web sites has changed very dramatically since 2003.
 
Oh my God.

I didn't notice the date. :D

I should be paying more attention to the post. :D

I apologize for that. :D
 
Last edited:
@amir100: It's cool. Sometimes you just find something interesting and don't notice if it's stale. No biggie.

Here's an interesting benchmarking article about hello world programs. It's a little old but here are some of the relevant timings:

VC++: 0.01 seconds
gcc: 0.03 seconds
Php: 0.05 seconds
C#: 0.09 seconds (assume equivalent to ASP.Net?)
Java: 0.44 seconds

Granted, this is an extremely trivial benchmark, but C# is slower than PHP. It appears that your assumption about compiled languages is correct (versus interpreted). My guess is that the amount of time necessary to ramp up various OO overhead and JIT compilation slows down C#. Java is probably so much slower because it is non-native (not built by Microsoft to specifically run on Windows).

I'd wager that most simple text I/O up to a point is going to be faster in PHP than it would be in C#. But if the program is big enough then the increased overhead of ramping up the .Net Framework would pobably pay off down the road. If the program is big enough or complicated enough, you'd probably be better off with ASP.Net.

The next big question is maintainability which, in my opinion takes precedence over speed. After all, clearly, if speed were such a huge concern, why don't we see more websites with C/C++ backends rather than PHP or ASP.Net?
 
Just looked at the site you linked to and as an example of performance 'hello world' was probably not the best ;)

For example Matrix Multiplication gives a cpu time of
C# : 0.45 secs
PHP : 53.27 secs

http://dada.perl.it/shootout/index.html gives the full list of test if any one is interested in the full comparisons.

One thing to bear in mind when comparing performance of a .Net application is the fact they are JIT (Just In Time) compiled - on the first execution of a given function you incur the overhead of compiling the MSIL code to native machine code. If a function is executed rarely (or only the once) this overhead can indeed far outweigh the benefits that compiled code gives...

Unless your application is very cpu bound though other factors will often play a bigger role in the overall performance of your application - efficiency of it's provided libraries, memory management, IO performance etc. can all make big differences at runtime.
 
Back
Top