Forest header image

Symfony Finland
Random things on PHP, Symfony and web development

PHP 7.1 vs. 7.0 performance benchmarks with Symfony

PHP 7.1 was launched on December 1st 2016. This was the first minor release after the release of 7.0 a year ago. PHP 7.0 was a revolutionary product, especially when it comes to memory usage and performance. PHP 7.1 is a more modest upgrade that brings new features and improved performance. But how much has performance improved from a year back?

In this case I followed the same procedures some earlier benchmarks, using the eZ Platform demo distribution (version 1.7.0 RC1). It is a fully fledged CMS running on the Symfony 2.8 Standard Edition.

As an application built on the Symfony Full Stack Framework, eZ Platform demo distribution represents a rather complex Symfony / PHP OOP application out of the box. The exact PHP versions used for here were 7.0.13 and 7.0.0. PHP settings were the defaults for both distributions.

The benchmarks follow the December 2015 benchmark methods so that runs are repeated three times and the average value. Notice that if you should not compare results directly to the ones from last year because both the hosting environment and the demo installation of eZ Platform has changed significantly. Also you can try free trial for high performance VPS on UpCloud.

Benchmark results and conclusions

In the first round we observe how Symfony and PHP boot up from completely uncached situation. PHP-FPM is restarted, meaning the APC opcache is completely void as is the Symfony cache directory. This means that the initial overhead is significant.

PHP 7.0 vs 7.1 Symfony Benchmark 2For the cold boot there is no difference in memory use, but PHP 7.1 does have an advantage of 6% or so in. On the second round both PHP's APC cache is full as is the Symfony container. This results in significantly faster request time, but again resulting in some 7% gain in performance.

Note that in these results the Symfony application is still running in development mode, thus resulting in a significant overhead for logging and limited internal caching.

PHP 7.0 vs 7.1 Symfony Benchmark 1

In the third set of benchmarks Symfony is ran in production mode and the frontpage is hit with requests consequently with concurrencies of 1, 10 and 50:

PHP 7.0 vs 7.1 Symfony Benchmark 3

In these results PHP 7.1 has an advantage of some 7% in the runs on low currency, but the lead closes to some 4% at higher concurrencies.

All in all there are definite improvements in PHP 7.1 over 7.0, but the changes are not as drastic as they were with the jump from 5.6 to 7.0. But there is clear improvement across the board, which is a positive sign and can yield savings when operating sites with high volume.

Best of all PHP 7.1 is pretty much a drop-in upgrade so accessing the improvements and new features is a no brainer. For more drastic changes you will need to look into future versions, such as PHP 8.0 with JIT and other improvements.

Related reading:


Written by Jani Tarvainen on Friday December 9, 2016
Permalink -

« Symfony Flex set to enable RAD (Rapid Application Development) - Lesser known Symfony eCommerce projects: WellCommerce and ONGR »