Asp. NET compete PHP test environment

Source: Internet
Author: User
Tags file copy sql server driver sql mysql net version drupal zend

Asp. NET vs PHP Speed Comparison

Phpchina information: Just in the September programming language rankings to make a historic breakthrough PHP in the field of Web Development is probably the most opponents is based on Microsoft. NET Technology of asp.net. Recently, Microsoft's Joe Stagner published a series of articles on blogs comparing PHP and asp.net performance, causing a lot of responses from both programmers. Joe said he would continue the test and look for a more appropriate way to reach conclusions that would be as valuable as possible to the actual project.

In general, the goal of performance testing is to try to prove that one side is quicker than the other, Joe said in his blog. I'm employed by Microsoft, and I write PHP and asp.net code. I'm here. NET before the advent of the use of PHP, two things I like.

So I can't say which is better. When I say good things about PHP, my Microsoft colleagues write to criticize me, and when I publish a preference for asp.net, my php friends will say that I am Microsoft's.

I did this test because everyone has a view of PHP's performance (Windows vs. Linux & 5.2 vs. 5.3), but no one can give you any specific data.

Asp. NET Competition PHP test environment is as follows:

    • All tests are run on the same machine (Toshiba Tecra M5 with 4G RAM and 60G 7200-turn drives).
    • The Ubuntu 9 and Windows Server 2008 Standard editions are installed on separate (but identical) hard drives.
    • Linux uses Apache2,windows to use IIS 7 as its own Web server.
    • Both sides of the operating system are fully patch or upgraded.
    • Both systems and runtimes do not perform additional performance enhancements.
    • From the experimental results, PHP performance in Linux and Windows have a few advantages:
    • Pure statement execution performs better on Windows.
    • function calls are faster on Windows.
    • object creation and access, for PHP 5.2来 said on Linux faster, but for PHP 5.3来 said it is windows faster.
    • Class library calls are much faster on Linux (such as encryption on Ubuntu is 3 to 5 times times faster than Windows).

Linux vs. Windows platform

Accessing file performance on Linux is slightly higher than Windows, but the performance of file replication on Windows is 60% slower than Linux, possibly because of high ACL security.
Accessing MySQL on Linux is a lot faster than Windows, and running PHP 5.3 on Windows is even worse (although this should be a bad implementation from the PostgreSQL below).

PostgreSQL's performance on two platforms is very close (1000 operating gaps within 0.06 seconds)-both PHP 5.3 and PHP 5.2,windows are slightly.

Windows PHP 5.2 Access to MS SQL Server is less performance than accessing MySQL on Linux (there is no SQL Server support for PHP 5.3 at this time).

For pure PHP performance, Linux is the same as Windows, which is not the deciding factor in choosing Linux or Windows as a deployment platform. If you are building an application, then PostgreSQL may be a better choice. Because it's excellent on two platforms.

If your application must use MySQL, then choosing Windows requires early planning extensibility issues (personally think Sun is unlikely to optimize MySQL's performance for Windows).

PHP's first version of SQL Server driver is slower than MySQL or postpresql, but this should not be a problem. A second version of the drive is under development, which can lead to performance improvements.

In Joe's view, overall, the PHP and IIS teams have been very successful in performing performance, and the next step is to optimize the performance of the various Open-source programs (Drupal, WordPress, Joomla, and so on) for each platform.

However, in addition to file copy operations, ASP. NET's overall performance ahead of PHP (whether deployed on Linux or Windows):

The performance of accessing MySQL on Linux is slightly better than the performance of accessing SQL Server on Windows (using normal data types and SELECT statements). But the gap here can be almost negligible.

Asp. NET (C #) operations, such as object use, class library invocation, and so on, have a much higher performance than PHP. For the test results, Joe added:

I know some of my php friends and Linux guys are going to jump out and refute my tests and results.

I've been thinking about whether this performance comparison needs to add some advanced optimization options. But. NET aspects, such as multiple threads, asynchronous requests, and various caching methods can be used

Please note-I did not say "ASP." NET faster, so you should not use php! "I use the view that PHP is too simplistic to be a bit difficult for some advanced applications, just as ASP.net has a learning complexity early in the project.

For me, the most exciting part of PHP is not its language/platform, but the thousands of smart PHP developers, as well as a variety of excellent projects (such as Drupal, Joomla, WordPress, PHPBB, nuke, etc.).

You can think that PHP is on the same level of performance on Windows and Linux that I can now finally write a PHP class library for Windows that I've been looking forward to for many years.

Joe also exposes the test code. If you have doubts about the results of this test, he says, you can do the experiment yourself, or write your own test code to test it.

After the article was published, many netizens expressed their views on the test results. Joe basically replies to one of the main ideas:

"I use asp.net just because I like the Visual Studio IDE"--I personally think that Visual Studio is the most productive development tool. However, PHP has a good choice. I use Zend Studio,phped,komodo,delphi for PHP, which is pretty good. I hate eclipse, but Zend has also done a lot for PHP development in this area.

You should compare the performance of ASP--No, thank you. Old-style ASP and the current PHP and ASP.net gap is too big. Making this comparison seems to suggest using ASP to develop new projects, and I strongly recommend that you do so.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.