PHP 7 performance improvements
As well as a range of brand-new features, PHP 7 came with drastically improved performance when compared to PHP 5.6. Zend Technologies, the engine behind PHP, ran performance tests on a variety of PHP applications to compare the performance of PHP 7 vs PHP 5.6. These tests compared requests per second across the two versions of the popular scripting language. This relates to the speed at which code is executed, and how fast queries to the database and server are returned.
WordPress and Drupal are content management systems (CMS) that run on PHP. These applications are used for personal or corporate blogs and websites, and between them they host over 25% of the websites on the internet.
A single WordPress request on PHP 5.6 executes around 100 million CPU instructions, whereas PHP 7 executes the same request with only 25 million CPU instructions.
The performance of WordPress 3.6 on PHP 7 was improved significantly compared to WordPress on PHP 5.6, with 112% more requests per second on PHP 7. And WordPress 4.1 executed 95% more requests per second on PHP 7 compared to PHP 5.6.
For Drupal, there are similar performance improvements on PHP 7 vs PHP 5.6. Drupal 7 on PHP 7 runs 73% faster, with 316 requests per second compared to 182 requests per second on PHP 5.6.
This means faster coding of WordPress/Drupal websites and themes, and a smoother interaction experience for the end user.
A sort of ‘code template’, a PHP software framework is used to increase efficiency of PHP application building. Instead of starting to build each application from scratch, a software framework gives the developer a scaffold around which to build their PHP application. Software frameworks are made even more efficient with PHP 7. Laravel on PHP 7 serves 70% more requests per second than Laravel on PHP 5.6, and Zend Framework on PHP 7 serves 95% more requests per second than on PHP 5.6. This makes it even quicker for developers to build applications, and requires less server space to do so.