Phoronix has released a performance benchmark report for PHP 8. Since PHP 8 Alpha1 won't be released until roughly mid-June, Phoronix built a version for testing from the latest PHP 8 Git code (as of the end of May). In addition to the newJIT compiler, important new features of PHP 8 also include new static return types, union types 2.0 (union types) andattributes (attributes), etc.
For more features, please refer to "New Features and Major Adjustments in PHP 8"
The versions used for reference comparison include: PHP 7.4. 6, 7.3.18, 7.2.31, 7.1.33, 7.0.33, 5.6.39, 5.5.38 and 5.4.44, and PHP 8 with JIT (Just In Time) enabled.
All tested versions were built in the same way on the same system using the same compiler and PHP configuration files. The test environment is as follows:
The test results are as follows:
The above figure shows the performance results of using PHPbench to test each version of PHP. It can be seen that there is a small improvement from PHP 7.4 stable to PHP 8, which is about 7% improvement. However, if PHP 8 enables JIT, the performance improvement can be said to be very obvious, which is 92% higher than PHP 7.4 stable. As for older versions, PHP 8 with JIT offers 5x the performance of PHP 5.4.
The above picture is the results of the microservice benchmark test of each version of PHP. Through some of the built-in tests that come with PHP, you can see that PHP 8.0 is slightly faster than the already fast PHP 7.4, and with JIT support enabled, its speed is even faster than the rest.
The test results in the above figure show that during the test using Phoronix Test Suite Self Tests, whether JIT is turned on or not, the performance of PHP 8
There is no significant improvement compared to PHP 7, mainly due to the I/O bottleneck, so overall there is not much difference.
Similarly, in terms of rendering testing and merge testing, JIT-enabled PHP 8 did not produce a significant advantage, but compared with the older version Compared with PHP 5, the performance of PHP 8 has been significantly improved.
The above is the detailed content of How fast can PHP 8 be? (Performance Testing). For more information, please follow other related articles on the PHP Chinese website!