PHP Group will no longer support PHP by the end of 4 to 07, so I did this test to make everyone more confident to transfer to the PHP 5 platform, look at PHP 4. is x really better than our PHP 5. x is better! The test results are obvious, that is, PHP 5. x is better than php 4. x is more object-oriented than PHP 4. x is faster, so it is absolutely necessary for everyone to move to PHP 5. x platform to experience PHP 5. x platform features and performance.
Because PHP 5 includes new object models, more new features, and faster processing speed, especially the processing speed of object-oriented Code, although the object-oriented code speed in php 4 is relatively average, however, in PHP5.x, the OSS code speed exceeds the process-oriented speed, so do not doubt the OSS performance. The following test results show all of this.
Test Environment
CPU |
Intel Pentium4 2.66 GHz |
Memory |
1 GB |
Disk |
73 GB/SCSI |
OS |
FreeBSD 4.11 |
Web |
Apache 1.3.37 |
Test Tool |
AB (you can also use http_load) |
Term RPS |
Requests per second (number of Requests per second) |
Related
Test Tool: AB (http_load can also be used)
Term RPS: Requests per second (number of Requests per second)
PHP 4.4.2 Test Results
Function
function signin(){ echo "test"; } signin(); ?> |
Test result: the result of AB-n 10000-c 50 is 1047.23/rps.
Class
Do not instantiate class
class User{ function signin(){ echo "test"; } } User::signin(); ?> |
Test result: the result of AB-n 10000-c 50 is 1034.98/rps.
Instantiation class
class User{ function signin(){ echo "test"; } } $user=new User(); $user->signin(); ?> |
Test result: the result of AB-n 10000-c 50 is 1006.14/rps.
Class inheritance
class AUser{ function signin(){} } claāss User extends Auser{ function signin(){ echo "test"; } } $user=new User(); $user->signin(); ?> |
Test result: the result of AB-n 10000-c 50 is 992.95/rps.
PHP 5.2.1 test results
Function
function signin(){ echo "test"; } signin(); ?> |
Test result: the result of AB-n 10000-c 50 is 1176.06/rps.
1