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.
Ecommerce on PHP 7
Ecommerce platform Magento drives more than 250,000 emerchants and is the most popular ecommerce platform in the world, and Magento runs on PHP.
Again, there are significant performance improvements when running Magento on PHP 7 compared to PHP 5.6. There is a 30% lower memory consumption with Magento on PHP 7, which means that one server can serve over three times as many user requests.
Homepage requests per second are improved by 68% on PHP 7, and catalogue requests per second are improved by 112% when compared to PHP 5.6.
This increased response time will decrease the time it takes for webpages to load. A lower page load time is vital for ecommerce websites, as it’s been shown that 25% of users will abandon their visit if a page takes more than four seconds to load – in an ecommerce environment, a lost visit is as good as a lost sale.
Read this guide on our support site to find out how to upgrade to PHP 7 with Fasthosts.