Php3,php4,asp Running Speed test

Source: Internet
Author: User
Tags win32 linux
Speed php3,php4,asp running Speed test

Test hardware Instructions:
The test used is my love machine, configured as follows:
cpu:c433
Memory: 128M
Hard drive: Cool fish 2 generation 20G

Test Software Description:
Windows NT Server4,sp5,apache 1.3.12,php3.0.15 and PHP4RC1,IIS4 are used under WIN32
Linux is Bluepoint linux1.0, Apache 1.3.12, Php4rc1

Test Code Description:
We use a high intensity loop to test the speed.
An initial value was set counter=1
A 100*100*100 cycle, counter++ in the inner loop
Because it was later configured PHP4 to run an ISAPI error under IIS, there was no test result.

Test code:

The PHP program is as follows:
<?php
$counter = 1;
Set_time_limit (300);
$begin _time=time ();
For ($i =1 $i <=100; $i + +)
For ($j =1 $j <=100; $j + +)
For ($k =1 $k <=100; $k + +)
$counter + +;
$end _time=time ();
echo "Begin Time:". $begin _time. " <BR> ";
echo "<br>end time:". $end _time. " <BR> ";
$total = $end _time-$begin _time;
echo "Total spent time:". $total;
?>

The ASP program is as follows:
<%
Counter=1
Begin_time=time ()
For I=1 to 100
For J=1 to 100
For K=1 to 100
Counter=counter+1
Next
Next
Next
End_time=time ()
Response.Write (Begin_time)
Response.Write ("<p>")
Response.Write (End_time)
%>

Test results in various environments

Environment: WIN32+APACHE+PHP4
Result: 3 seconds

Environment: WIN32+APACHE+PHP3
Result: 19 seconds

Environment: win32+iis4+asp
Result: 4 seconds

Environment: WIN32+IIS4+PHP3
Result: 30 seconds

Environment: WIN32+IIS4+PHP4 (CGI)
Result: 3 seconds

Environment: WIN32+IIS4+PHP4 (ISAPI)
Results: None

Environment: LINUX+APACHE+PHP4
Result: 4 seconds

Conclusion:
Who says ASP is much faster than PHP? According to my test results, it seems to be the same. Of course PHP4 in the Zend acceleration, performance than PHP3 a lot of ascension.
Just what I don't understand is that the test results under Linux are even slower than WIN32!
As we all mentioned JSP, because I did not install, so I can not test it. But later I will install one, then will test the result to everybody.


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.