PHP and ASP.NET go HEAD to HEAD

S

showme

PHP and ASP.NET Go Head-to-Head
By Sean Hull
http://otn.oracle.com/pub/articles/hull_asp.html


SUMMARY at the BOTTOM
Speed and efficiency. As I mentioned earlier, ASP.NET is a framework
allowing you to use various programming languages. In addition, it is touted
as having a great object-oriented model. All this is true, but it becomes a
detriment as far as speed is concerned. For all that advantage, there is a
lot more code to run through to execute the same ASP page than you have to
execute in the PHP engine for an equivalent PHP page. PHP is the
quick-and-dirty type of solution, the one to get the job done. And though a
lot of robustness has been added to it since its 2.0 and 3.0 days, it still
retains that core optimized high-speed approach.
Speed is not the only consideration. Memory usage is also important.



SECURITY COMPARISON
ASP.NET officially requires that you use IIS. Unfortunately, IIS has a long
history of vulnerabilities, which makes many administrators reluctant to
deploy it to handle their web site. Whether these weaknesses are because of
Microsoft's ineptness or because IIS is a real red flag to hackers is
irrelevant: Those systems have a history of being hacked and compromised.
PHP runs on Apache, too, which is fast and open source and has a good
security track record. Also, as I mentioned, Apache runs on many platforms.


So is PHP really faster than ASP.NET or is that for certain unoptimized
pages? And are they comparing this against the DataGrid instead of the
repeater control or even the fastest way using asp.net's inline code render
block, <% %>

comments?
 
S

Simon Harvey

Its a fair point, but to be fair the OO aspect is aimed at helping speed
development rather than speed execution. Most sites don't need blistering
speed and processors are getting faster and faster.

The speed issue is becoming less and less of an issue for the majority of
sites. I say this as a web host for many large sites including international
airports

Only one of our sites requires a dual 2.4 xeon machine

Our database server is also dual xeon.

Oh, and php is ugly imho

Let the flames begin

:)
 
P

Patrice

The sad truth is that at some point you have to look at things against your
own requirements to make your own mind as you would do for choosing a car
(including both rational and unrelational arguments). That's life.

Patrice
 
K

Kevin Spencer

comments?

Consider the source. Also note that a number of comparison criteria are
simply ignored, such as development speed/cost. The most expensive aspect of
development is the cost of developers (man-hours of dev time). While ASP.Net
consumes a large chunk of memory and processor, RAM is cheap; hardware is
cheap; programmers are expensive. ASP.Net is designed to give the
implementers a greater ROI. This is the bottom line when it comes to
software development. That is why Oracle is in so much trouble financially.
It costs more to use it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
M

Michael Pearson

I could not agree with you more Kevin.

Programmers are expensive (at least here in the USA) and computers are
inexpensive. I'd much rather crank out an entire site in half time time
with ASP.net than spend twice as much time getting the same result in PHP
that runs faster.

It's an ROI thing and a time-to-market thing.

Michael
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

It is not a fair comparison (Oracle comparison), but I am sure there are
areas where PHP is faster. Even classic ASP beats ASP .NET in some areas.

Much of the benefit of .NET is not in the performance alone. Maintenance,
which is more expensive than perf in most cases, is greatly improved over
ASP and SO much easier than PHP.

But, everyone loves perf numbers. SO much so that I have seen sites that
were virtually unmaintanable, just to squeek out a few more cycles ... on a
site already running well below the bar. I call that STUPID, although some
may disagree! ;->

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

Maintainability costs far more than perf in the majority of the cases. ;->

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
M

Marcus

That is why Oracle is in so much trouble financially.
It costs more to use it.Kevin Spencer wrote:
Err what?
Oracle had a net profit of $1 bil last quarter, $8+ bill in cash
($4 Bil after AP and debt), $8 bil in total assets, and revunue is
increasing (quarter over quarter and year over year). Looks like
they are doing pretty good.
 
K

Kevin Spencer

Roger that, Greg. As every professional developer knows, an application is
never "finished."

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
B

Bob Grommes

What is "head to head" about his comparison? I don't see the detailed
analysis that "head to head" implies. In fact I don't see much analysis at
all. I wouldn't be impressed even if I were a PHP partisan; indeed, I'd be
worried.

The author of this article is preaching to the choir, giving them some ammo
to use in proselytizing and encouraging the faithful, and some flip
dismissive statements on flash cards to use against doubters. Which is to
say, it's not at all deep reasoning.

He makes bold assertions about performance but makes no effort at all to
support them.

Of course even if he offered code examples and benchmarks, everyone's
mileage (and evaluation criteria) would vary. But at least you would have
some idea what he is basing his statements on.

All in all, this struck me as someone writing to arrive at a predetermined
conclusion but with enough skill to give some appearance of even-handedness
by saying some Nice Things about ASP.NET (just before dismissing it in so
many words as obviously inferior).

Others have already made good points that many cost factors beyond runtime
performance must be considered in comparing platforms -- and ASP.NET is no
performance slouch anyway. Another point for me is that I *like* having all
the core pieces of the platform come from one vendor. I hate the
finger-pointing that goes on when you try to get various products to
interoperate with each other. Say what you will about MSFT development
platforms -- the quality is generally very good and the end-to-end
integration is wonderful, especially if you're a smaller shop.

I don't miss building non-trivial sites in classic ASP. I probably wouldn't
want to take half a step backwards and build one in PHP either, unless PHP
addresses something interesting relative to ASP.NET besides raw runtime
performance.

--Bob
 
J

Jerry Pisk

I'm just going to add one more - MySQL is a lot faster than Oracle. Because
it doesn't support transactions and so on. Does it mean it's better? That
depends, the same way PHP versus Asp.Net depends. You're trading off
features for speed and most of the time it's those features that are going
to make your life a lot easier.

Jerry
 
J

John Timney \(Microsoft MVP\)

I've recently had to switch from a PHP app because its performance is not
good enough, however - theres not a web language on the planet that could
have performed to the standards we wanted, so its not a criticism on PHP.
ASP.NET could not have handled the job either and we were using mySQL rather
than Oracle.

What does this imply, well only that you have to take these things with a
pinch of salt, Oracle have an interest in saying this stuff on their site -
and the writer has an interest in more perople switching to PHP as it might
mean more work for him. So the view will typically be biased.

The conclusion should have actually demonstrated some real world
comparisons, including design issues, maintenence, server architectures,
speed of development etc. I think PHP 5 will have a lot to offer and will
only complment the available languages on the web - but head to head with
asp.net will need to be a few pages longer and a bit more fact driven than
what this chap has offered.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
S

Sherif ElMetainy

Hello

The author of the article is very biased. I have been worked with PHP and
ASP since 1999 and I worked with ASP.NET since it was beta in 2001. PHP is
much better than regular ASP, but ASP.NET is much better than PHP.

I disagree with the author of the article in the following points:

- ASP.NET can run on Apache as well as IIS

- With Mono (http://www.go-mono.org), ASP.NET can run on Linux and other
operating systems

- IIS 6 doesn't have the bad security reputation as IIS 5, and with a good
administrator IIS 5 can be secure.

- I made a simple XML web service with ASP.NET and PHP 4, and ASP.NET was at
least 10 times faster. I was using nusoap
(http://dietrich.ganx4.com/nusoap/index.php)

- Even in areas where PHP may be faster, ASP.NET is more scalable. So if the
application has a lot of load, you can add more hardware and ASP.NET will
utilize it better and perform faster, while PHP is not as scalable as
ASP.NET

- The cost of development and maintenance for PHP code is much higher than
ASP.NET.

All my comments above are based on my experience with PHP 4, I didn't test
PHP 5, but I think PHP is suitable only for small applications, and never
large applications. For medium to large applications I would recommend
ASP.NET or even JSP, but never PHP.

Best regards,
Sherif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top