PHP 4-07 at the end of the PHP group will no longer support it, so in order to let people more confident transfer to the PHP 5 platform, I specifically did this test, to see if our PHP 4.x really performance than our PHP 5.x better! The test result is obvious, that is PHP 5.x than PHP 4.x, whether object-oriented or process-oriented, is faster than PHP 4.x, so it is necessary to transfer to the PHP 5.x platform, to experience the various functions and performance of the PHP 5.x platform.
Because PHP 5 includes the new object model, more new features, faster processing speed, especially the speed of object-oriented code, although in PHP 4, object-oriented code is more common, But object-oriented code in php5.x is faster than process-oriented, so don't be skeptical about object-oriented performance, as the following test results will show.
test Environment
Cpu |
Intel Pentium4 2.66GHz |
Memory |
1GB |
Disk |
73gb/scsi |
OS |
FreeBSD 4.11 |
Web |
Apache 1.3.37 |
Test tools |
AB (can also choose http_load) |
Term RPS |
Requests per second (number of requests per second) |
Related
Test tool: AB (can also choose http_load)
Noun rps:requests per second (number of requests per second)
PHP 4.4.2 Test Results
Functional Function
function signin () { echo "Test"; } Signin (); ?> |
Test result: The result of Ab-n 10000-c 50 is 1047.23/rps
Classes Class
Do not instantiate a class
Class user{ function signin () { echo "Test"; }
User::signin (); ?> |
Test result: The result of Ab-n 10000-c 50 is 1034.98/rps
Instantiating classes
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
Inheritance of Classes
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
Functional function
function signin () { echo "Test"; } Signin (); ?> |
Test result: The result of Ab-n 10000-c 50 is 1176.06/rps
1
http://www.bkjia.com/PHPjc/446793.html www.bkjia.com true http://www.bkjia.com/PHPjc/446793.html techarticle PHP 4-07 at the end of the PHP group will no longer support it, so in order to let people more confident transfer to the PHP 5 platform, I specifically did this test to see if our PHP 4.x is really ...