Overall I’ve been pretty impressed with the reactions to my first round of PHP/Linux/Windows/ASP.NET performance tests.
I’d like to comment of the comments
First, while I appreciate the enthusiasm of my .NET friends, the point of my exercise was to give me (and other folks at Microsoft) a starting place to understand some things about the performance of PHP on Windows and of ASP.NET.
If your faith in ASP.NET is incrementally sustained by virtue of this data than I’m happy. If I didn’t think that .NET was a as good as or better than any other technology for building web applications then I wouldn’t be working here at Microsoft.
But ….. It is incorrect and naïve to use this little bit of data to discount PHP out of hand.
I have much more work to do and there are many considerations.
- These are BASE performance data. It is unwise to take a little bit of favorable data and use it to make sweeping conclusions.
- There are many more performance factors we need to research.
- PHP as a core technology easily scales out with hardware additions, hardware can often be considered cheap under the right circumstances.
- Though my environment emulates my shared Linux host, enterprises will use op-code caching and we should consider this scenario (test results coming soon.)
My goal isn’t to show PHP on Windows is faster than PHP on Linux – my goal is for PHP on Windows to ACTUALLY BE faster. The same with ASP.NET. These tests have provided useful data to some of our internal feature guys already and they are taking action as a result.
Here are some general statements, assumptions, etc and my responses.
- “I would utilize ASP.net simply because I like the Visual Studio IDE” – I personally think Visual Studio is far and away the very best, most productive developers IDE ever made. But, there are some pretty good ones for PHP. I use Zend Studio, PHPEd, Komodo, Delphi for PHP and all are great. I loathe Eclipse, but Zend has done a good job extending it for PHP Developers.
- In regards for requests to compare the performance of Classic ASP to ASP.NET – No thanks !!!!! Classic ASP is not nearly the development technology or EITHER today’s PHP or ASP.NET. To do a comparison is to suggest that folks might do new development in Classic ASP and I couldn’t recommend more strongly that you move n from Classic ASP.
- 32 bit versus 64 bit ? – The nature of these tests would likely not show any statistically significant differences by the additional address space of 64 bit. In future tests where I add load simulations, I will add 64 bit scenarios to the tests.
- “PHP is ugly like hell” – Oh, I beg to differ. Classic ASP was MUCH uglier !! You can write terrible and ugly PHP code. As you can write terrible and ugly C# and VB code. On the other hand, you can write very elegant C++ style code in PHP. It is completely a factor of the developers skills and attention to detail.
- Adding Apache on Windows to the tests. – No thanks. Apache is THE server on Linux but IMO, you’re missing out on a TON of opportunity if you don’t use IIS 7.x on Windows !
- “Adding a XAML/Silverlight comparison would be a good idea.” – This would be interesting, but a little out of scope. First, the tests would only be interesting if we compared the performance of logic that could be run EITHER server or client side. Then, in addition to the server side execution performance I would need to duplicate the tests in Adobe Flash and JavaFX in order to be really meaningful. I’ll add it to my list for a later set of tests.
- “Is there a way to improve the performance of the file copy test on Win2k8 ASP.Net 2 without compromising security?” – Probably not. I think this has to do with the ACL system used by Windows Server. I might test the performance reading and writing files through streams to compare the performance. Some things will just be faster on one side or the other; luckily, mass programmatic file copy operations aren’t too common for web applications.
- “PHP has always been, and will always be, tailored to semi-professional environments.” – No disrespect, but this is simply bullshit ! There are MANY professional / high quality sites and applications written in PHP and there are many PHP developers who’s work I greatly respect. Professional / Not professional is a factor of the developer’s skill, not PHP or ASP.NET
- “But Linux is Free” – Well……. This is a great topic for discussion. I’ll get to it in a bit
- “I don’t think it’s fair to compare PHP without an opcode cache… You can’t compare an opcode cache to page caching. .Net has the benefit of using bytecode, while PHP has to parse the file and "compile" for each page request. So you deny PHP the advantage that .Net has” – I agree this test is necessary for completeness, but I’m not sure the logic holds. I tested PHP as you would download and install it. My shared host does not have op-code caching installed. The fact that it’s built in to ASP.NET and not PHP doesn’t make my test unfair, it’s MISSING from PHP. That said- the request is valid and I’m working on it.
- “Please add Perl, Python, Ruby, etc.” – Someday I might, but these web development options are relatively unimportant (to me) since the developer market share of these are still just a tiny fraction of that held by ASP.NET and PHP. (I am more interested in JSP though.)
- “if you get around to doing that kind of test, you should probably account for the fact that it typically takes hours to set up and configure a Windows server (while most Linux sysadmins can do it in under 10 minutes).” – This just isn’t true. EXPERIENCED Windows and Linux Admins can do equally impressive things deploying servers within their respective areas of expertise.
- “Saying that PHP isn’t a "professional" language is just dippy, since nearly all of the largest web sites in the world today were built with PHP.” – It is dippy, but it’s also WRONG to say that “nearly all” are built with PHP. Some are, some aren’t.
- “Why didn’t you use Zend Page Cache to negate that effect to bring it to an equal footing with ASP.NET?” – As mentioned above. It’s not part of core PHP, the exercise wasn’t to do a bunch of custom stuff to get PHP to be as fast as ASP.NET, though as I mentioned, I’m going to work on an test with Op-Code caching.
- “What about Mono” – Email Miguel, he probably already has some relevant data.
- Exo – you’re a jerk
- “Win + ASP.NET + MySQLWin + ASP.NET + PostgreSQL” – Yep !!! These are in the works !!
There were another couple of interesting comments ….
“I’m not a developer I’m a user.”
… and
“most of these (PHP) projects are perfect examples of heavy spaghetti, anti-pattern software.”
From a pure technology perspective, I find .NET to be far more powerful than PHP, but that doesn’t mean PHP is not powerful.
IMO, PHP’s power is in the network of applications and frameworks that are available.
Though many PHP “users” are “real” developers, many are as the commenter suggests, “Not developers, but rather users”.
As to the second quote, sure, I’ve looked at lots of ugly PHP code. I’ve done lots of work with PHP-Nuke and PHPBB and neither is coded in an elegant or OOP way.
But, both those applications ROCK !!!! Lots of the PHP-Nuke code is UGLY, but it works !!! (A lot of the world’s business systems are still running on really UGLY COBOL code.)
I used PHP-Nuke for years and made a habit of sing a code formatter and cleaning up modules or pages as I “touched” them.
Though both PHPBB and PHP-Nuke are “out of favor” I still use and love them. I also now use and love Drupal, Joomla, SMF, and VBulletin, as well as many others.
THIS !!! Is why I’ve been on this 8 year mission to get PHP on Windows working well and to get PHP and .NET working together !! I wanna use PHP applications and have access to the amazing power that is .NET
So, that’s a lot of rambling, but there is one more topic that I deferred higher up in this text.
TCO ! ?
Craig asks a GREAT question – “ …. isn’t it TCO that counts?”
Yup !
Total “cost” is a factor of SO many thing.
Microsoft can convincingly and truthfully explain to you why .NET offers that best TCO ratio !!!!
The problem is, Zend can truthfully explain to you why PHP offers that best TCO ratio.
Everyone who dislikes the state of ANY technology comparison bails out to fuzzy TCO claims.
I’ll get to TCO data that is perf/scale based (after much more testing.)
I’d be very interested in seeing any REAL data either way.
In any event – thanks for reading. More to come !
[ You can read the original post HERE ]





















RE: Comments on my recent benchmarks.
Pingback from Posts about work as of August 10, 2009 | SLYFLIX
RE: Comments on my recent benchmarks.
Pingback from Comments on my recent benchmarks. « Free Hosting News
RE: Comments on my recent benchmarks.
Pingback from Comments on my recent benchmarks. : Misfit Geek
I’ve supported PHP applications in the past requiring code modifications. At present I’m working on an ASP.Net application which is getting larger and larger in terms of the amount of code for the required functionality.
My experiences supporting web applications are that PHP and ASP.Net stood pretty even in reliability and performance once up and running.
I recall the main thing with PHP that stood out was finding code more difficult to manage and work with due to the inline coding nature of PHP. It wouldn’t make a big different on smaller web applications.
The mere thought of coding my current ASP.Net web application in PHP makes me want to reach for a bottle of aspirin. The complexity and amount of classes that are there has given me a real appreciation for ease of development and code/language structure, the way ASP.Net fits together.
What are other people’s thoughts on ease of development and working with inline code blocks in the middle you’re of mark-up? This is an area PHP could really improve on.
RE: Comments on my recent benchmarks.
Pingback from Comments on my recent benchmarks. | ASP Scribe
RE: Comments on my recent benchmarks.
Pingback from Comments on my recent benchmarks. : Misfit Geek | Webmaster Tools
RE: Comments on my recent benchmarks.
Pingback from Comments on my recent benchmarks. | I love .NET!
RE: Comments on my recent benchmarks.
Pingback from Comments on my recent benchmarks. : Misfit Geek
Coding algorithms and is optimized with a proper php asp.net becomes the greater. Most people are quick php but since 2005 m in asp.net. asp.net is a ten-speed side of php did not see. If you’re using something ready and available in asp.net component, etc. do not optimize the code in here or microsoft asp.net is not a crime.
Sorry. My English is bad: (
Martin – Apparently you worked with PHP years ago. We have improved a lot in terms of avoiding the good-old spaghetti code. PHP 5 has awesome OOP patterns and constructs that help us in maintaining our code organized.
PHP has other limitations, which is how I ended up in this post after finding the link in an asp.net site. For example, the best thing for PHP is also its worst: too much variety. It’s good because it’s free and open-source. It’s bad because there is no corporate support (licensing issues I guess) and documentation is poor.
Anyway, for the most part, after a freaking year learning this industry on my own; I think asp.net is way more powerful than any other server-side language. I’ll probably use PHP for a little longer because I have two sites running on Joomla. But for my very own customized, revolutionazing, mind-breaking, last-coke-in-the-desert application that will make me millionaire, I’ll probably use asp.net mvc. It’s just so hard to get a php application up and running. Plus, you never have the full confidence that your local version will work once deployed. There are so many uncovered and unpredictable possibilities that can render your code useless. For example, apache mod_rewrite, it depends on how the http.conf is set somewhere in the server. I had a nice .htaccess that rewrote my urls nicely in my local apache installation. When I deployed to test it, it didnt work (and everything went to index.php). Probably (most likely) it was my mistake. But to know that kind of detail, I would have to be not only a PHP expert, but an Apache expert. And then the learning curve gets steeper or I have to hire someone to help me. So what I saved on a cheap hosting, I paying back on a steep learning curve, weeks the site being offline.
So, my decision is (oh my God, this is helping decide): if I want a site up and running fast, now, ahora and ya: use an open-source content management system like Drupal or Joomla. If I want to develop something customized using a framework: go ASP.NET. Enough said.
What about Java in all this ?
RE: Comments on my recent benchmarks.
Pingback from Comments on my recent benchmarks. | rapid-DEV.net
Thank you for having a very level, logical, and unbiased head in this very passion and emotion filled debate. When it comes to this topic, most debates are more biased than politics!
Hi
Congratulations for the article
Please make a comparation between ASP.NET and jsp(faces, etc)
I always love php, but i think asp.net is great and now i prefer to use .net
Joe, you rock. Looking forward to some TCO info. The real deal, not the business hype stuff, which frankly, I’m sick of. I also like the power of .NET, but if there is a better all-around solution that overall costs less, I’m all over that.
Remember, when you combine PHP and OOP, sometimes you just get PHPOOP…
I think that ASP.NET, PHP and .NET Framework should be distinguished correctly. ASP.NET is a subset of .NET Framework. But many PHP programmers can not see the difference. Many parts (WCF, WF, and many others) represent a separate island. What about implementation of SOA. What about elegance and simplicity of WCF?
In my opinion, .NET Framewrok is comparable to JAVA, and ASP.NET to PHP. I have met many PHP developers (I am .NET developer, and .. asp.net developer)… and I found that many of them was talking about ASP.NET only because of "competition".
But the truth is that for the normal critics we need to know both platforms.
The power of .NET is impressive.
RE: Comments on my recent benchmarks.
Pingback from Posts about work as of August 11, 2009 | SLYFLIX
Let developers choose their favouriate one. A Chinese sayings, which actually means "Give free reign to all styles of art and all schools of thought"
A coll post~
Thanks for share
Joe, you are too diplomatic and choose your words very carefully. The bottomline is that the numbers you got from your testing convey the important part: ASP.NET is much better than PHP when considering performance!
In terms of development, ASP.NET is certainly more readable and easier to maintain! Microsoft is clearly leading in development tools, technologies and languages.