PHP 7.4 Performance Benchmarks Show A Nice Improvement - But PHP 8.0-dev Is Running Even Faster

Written by Michael Larabel in Software on 21 November 2019. Page 1 of 3. 17 Comments

PHP 7.4 is due to be released next week as the annual major iteration to PHP7. Like we have seen through the PHP7 releases, while new features continue to be tacked on for this popular web-based programming language the performance has continued evolving. Here are the latest benchmarks of PHP 5.6 through PHP 7.4 while also looking at the PHP 8.0-dev performance that is in development on Git master.

Outside of the performance realm, PHP 7.4 is another exciting update thanks to finally introducing FFI support. The Foreign Function Interface for PHP allows accessing C structs/functions/variables from native PHP code for making it easier to interact with C libraries from PHP.

In addition to the headlining FFI support of PHP 7.4, this next release has a preload function to preload functions/classes to speed-up the loading of scripts by 30~50%, language alterations, TLS 1.3 support in PHP OpenSSL streams, and a variety of other smaller additions.

For getting an idea of the PHP 7.4 performance ahead of the official tagging next week, on an AMD EPYC 7642 server I ran some fresh benchmarks of PHP 5.6.40, PHP 7.0.33, PHP 7.1.33, PHP 7.2.24, PHP 7.3.11, PHP 7.4-RC6, and PHP 8.0-dev. All PHP builds were configured in the same manner and built with the same compiler. From there I ran a few different pure PHP benchmarks for seeing how the PHP performance itself is looking outside of any web server context and without the new preload feature or other changes.

PHP 7.4 Performance Linux AMD EPYC

The AMD EPYC 7642 server for this round of PHP testing was running Ubuntu 19.10 with the Linux 5.4 Git kernel. PHP benchmarks were run via the Phoronix Test Suite.

Related Articles